Run method 
Author Message
 Run method

I am trying to use the Run method of the WShell object to start a program on
a client machine.  The script is VBScript and follows the examples posted.
The problem I have run into is that if the executable file is in a directory
that contains a space then I get the "file not found" scripting dialog.
Anyone else experience this/solve this?

Example Code:

  Set WshShell = Wscript.CreateObject("Wscript.Shell")
  WshShell.Run "c:\my documents\myavipla",1,TRUE

Thanx,
Bobby Roberts



Sun, 11 Feb 2001 03:00:00 GMT  
 Run method
Have you tried this:

WshShell.Run '"c:\my documents\myavipla"',1,TRUE

Enclose the "c:\my documents\myavipla" in single quotes --> '

See Ya


Quote:
>I am trying to use the Run method of the WShell object to start a program
on
>a client machine.  The script is VBScript and follows the examples posted.
>The problem I have run into is that if the executable file is in a
directory
>that contains a space then I get the "file not found" scripting dialog.
>Anyone else experience this/solve this?

>Example Code:

>  Set WshShell = Wscript.CreateObject("Wscript.Shell")
>  WshShell.Run "c:\my documents\myavipla",1,TRUE

>Thanx,
>Bobby Roberts




Mon, 12 Feb 2001 03:00:00 GMT  
 Run method
I had this same problem, i solved it by using the full dos path and file
name.


Mon, 12 Feb 2001 03:00:00 GMT  
 Run method
Try putting an extra set of quotes around the string.

Ian Morrish
WSH FAQ http://wsh.glazier.co.nz
Home page http://www.glazier.co.nz
NetMeeting http://ils.glazier.co.nz


Quote:
>I had this same problem, i solved it by using the full dos path and file
>name.



Mon, 12 Feb 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Error running CACLS with Run method

2. Error running CACLS with Run method

3. Run Method not closing the window:

4. run method

5. Run-Method under IE

6. trouble with the RUN method

7. run method

8. Run Method and Double-quotes in command

9. Ole Automation Error when calling Run method of IWshShell_Class

10. Problem with calling multiple instances of the Run method

11. Can't Launch Office 2000 shortcuts using RUN method in Win2k

12. VB6: WScript Run method yields Permission Denied in Win2k

 

 
Powered by phpBB® Forum Software