Windows Scripting
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsSystem AdministrationWindows Scripting

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 15th, 2007, 05:45 PM
hermit hermit is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 2 hermit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 31 sec
Reputation Power: 0
Opening windows explorer on another folder

OK, This is embarassing but I cannot get this script to work. All that I want is to double click on the script which will open windows explorer to the folder I specify. I got the script from Scripting Guy.

Set objShell = CreateObject("Wscript.Shell")

strPath = Wscript.Arguments(0)

strPath = explorer.exe /e,c:\Dell
objShell.Run strPath

The error is in line 5; Char 12; Error Expected end of statement.

Any Help would be appreciated. First Script!

Tim

Reply With Quote
  #2  
Old January 15th, 2007, 10:09 PM
markoc's Avatar
markoc markoc is offline
Contributing User
ASP Free Regular (2000 - 2499 posts)
 
Join Date: Nov 2003
Location: UK
Posts: 2,160 markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level)markoc User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 3 Weeks 20 h 31 m 46 sec
Reputation Power: 220
Opening windows explorer on another folder

if ur not passing the path in the command to run the script, you don't need the Wscript.Arguments(0) and also u need to put the path inside double quotes.

see below for example...


Code:
Set objShell = CreateObject("Wscript.Shell")
strPath = "explorer.exe /e," & "c:\DELL"
objShell.Run strPath
Comments on this post
Shadow Wizard agrees!
__________________
Hope this advise helps.

If so please show your appreciation by adding reputation points (click gauge image on top right of this post and score).

Reply With Quote
  #3  
Old January 15th, 2007, 10:19 PM
hermit hermit is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 2 hermit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 31 sec
Reputation Power: 0
Thumbs up

Quote:
Originally Posted by markoc
if ur not passing the path in the command to run the script, you don't need the Wscript.Arguments(0) and also u need to put the path inside double quotes.

see below for example...


Code:
Set objShell = CreateObject("Wscript.Shell")
strPath = "explorer.exe /e," & "c:\DELL"
objShell.Run strPath


Excellent. Thank You for your help. It all works well now!!!

Reply With Quote
Reply

Viewing: ASP Free ForumsSystem AdministrationWindows Scripting > Opening windows explorer on another folder


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT