wshshell.run: I can't run when there is a space in the path 
Author Message
 wshshell.run: I can't run when there is a space in the path

Do you know any workaround to run a program that contains a space in the
pathname ?

Example:
set wshshell = WScript.CreateObject("Wscript.Shell")
     wshshell.run "C:\Scripts R1\NOTEPAD.EXE"    ' **** Note the space
between "Scripts1" and "R1". It doesn't work



Sun, 20 Apr 2003 05:21:31 GMT  
 wshshell.run: I can't run when there is a space in the path

hi Billy,

Use another set of quotes.

wshshell.run Chr(34) & "C:\Scripts R1\NOTEPAD.EXE" & Chr(34)

cheers, jw


Quote:
> Do you know any workaround to run a program that contains a space in the
> pathname ?

> Example:
> set wshshell = WScript.CreateObject("Wscript.Shell")
>      wshshell.run "C:\Scripts R1\NOTEPAD.EXE"    ' **** Note the space
> between "Scripts1" and "R1". It doesn't work



Sun, 20 Apr 2003 06:10:18 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. WshShell.Run "path with spaces" fails

2. WshShell.Run don't run WHY ???

3. Batch file won't run with WshShell.run

4. WshShell.Run does not work with spaces in pathname

5. WshShell.Run: Spaces in variable

6. run a script with spaces in the path?

7. object.run with a space in path and a command switch

8. how to specify a path without spaces inbetween to a shell.Run command

9. Running COMMAND.COM with WshShell.Run

10. Pls Help-Can't get wshshell.run to work

11. WshShell.Run vs WshShell.Exec

12. runas with WshShell.Exec versus WshShell.Run

 

 
Powered by phpBB® Forum Software