Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


running certain proggy's

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,3514
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> running certain proggy's
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 running certain proggy's - 6/23/2005 2:58:45 PM   
  pbrundog

 

Posts: 13
Score: 0
Joined: 6/23/2005
From: USA
Status: offline
well when I posted that first message it was for scripts at my work, to generate some logon scripts for certain groups of users, but now Im at home and Im having an issue in trying to run a program... World of Warcraft, I want to make a simple script that will open it and do a few basic things for me, but the problem I have is that it doesn't easily recognize what program Im trying to open:

dim pb1
set pb1 = createobject("wscript.shell")
pb1.run "WoW", 1
wscript.sleep 8000
pb1.sendkeys "username{tab}password~"


now for the "WoW" I've tried:
"World of Warcraft"
"C:\Program Files\World of Warcraft\WoW.exe"

among a few other things, but no matter what I get a runtime error saying it cannot locate the file...

also I tried creating a variable called location1 and setting it equal to "C:\Program Files\World of Warcraft\WoW.exe" and then putting
pb1.run location1, 1
that was yet another failure...

so ya any help on this would be greatly appreciated

_____________________________

TV may make you feel ignorant, but nothing rubs it in quite like a computer.
 
 
Post #: 1
 
 Re: running certain proggy's - 6/23/2005 3:12:20 PM   
  Xandros

 

Posts: 100
Score: 0
Joined: 6/23/2005
From:
Status: offline
Try this (of course, it depends on this being the correct path & exe name):

strCommand = "C:\Program Files\World of Warcraft\WoW.exe"
pb1.run chr(34) & strCommand & chr(34)

Embedded spaces in the path names will cause a problem, otherwise.

If that isn't successful, try this alternative:
pb1.run "cmd /c " & chr(34) & strCommand & chr(34)

(in reply to pbrundog)
 
 
Post #: 2
 
 Re: running certain proggy's - 6/24/2005 12:45:32 AM   
  mbouchard


Posts: 1922
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
xandros' first suggestion should work as there are spaces in the path you need to enclose it in quotes. Also, if you want to undo whatever it is you are doing after wow exits, make sure to add a ,1,True to the end of your run command.

(in reply to pbrundog)
 
 
Post #: 3
 
 Re: running certain proggy's - 6/24/2005 5:41:47 AM   
  pbrundog

 

Posts: 13
Score: 0
Joined: 6/23/2005
From: USA
Status: offline
thanks guys it worked perfectly, and Im not quite sure I get what u mean tho for the "if u want to undo whatever it is you are doing after wow exits"
Im not quite understanding what u mean, if u could elaborate I'd be grateful :)

(in reply to pbrundog)
 
 
Post #: 4
 
 Re: running certain proggy's - 6/24/2005 8:48:22 AM   
  Xandros

 

Posts: 100
Score: 0
Joined: 6/23/2005
From:
Status: offline
The Run method of the Wscript class provides for 3 parameters... the last two are optional. They control the "windowstyle" and the "synchronicity" of the spawned process. 1, True specifies to display the shell window and to force the current script to wait until the spawned process terminates before resuming with the next statement. Here's a link describing the parameters:
http://www.ss64.com/wsh/run.html

(in reply to pbrundog)
 
 
Post #: 5
 
 Re: running certain proggy's - 6/25/2005 4:13:55 AM   
  pbrundog

 

Posts: 13
Score: 0
Joined: 6/23/2005
From: USA
Status: offline
ah, that's actually quite handy to know as I was trying to figure that out as well (you just saved me having to bother you with yet another obnoxious question :-D)

(in reply to pbrundog)
 
 
Post #: 6
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> running certain proggy's Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts