shell command with space in path/file name does not work 
Author Message
 shell command with space in path/file name does not work

Just launch like this:

Shell "c:\program files\Windows NT\Accessories\wordpad.exe ""c:\program
files\sfstart.txt""", vbMaximizedFocus

This puts " round the path so notepad opens it correctly.

HTH

Max Bolingbroke


Quote:
> I am trying to use the shell command to start wordpad and
> then load a text file.  It works fine if the path does not
> have a space for example: "c:\test\test.txt"

> However, when the patch contains a space I cannot get it
> to work.  This is the command I am trying to execute.

> Shell "c:\program files\Windows NT\Accessories\wordpad.exe
> c:\program files\sfstart.txt", vbMaximizedFocus

> Any help would be greatly appreciated.



Tue, 13 Jul 2004 03:50:25 GMT  
 shell command with space in path/file name does not work
maybe try using

Shell """c:\program files\Windows NT\Accessories\wordpad.exe
c:\program files\sfstart.txt""", vbMaximizedFocus

this will insert a double quote into the string which is commonly
necessary when dealing with "long" path names...

D.


Quote:
> I am trying to use the shell command to start wordpad and
> then load a text file.  It works fine if the path does not
> have a space for example: "c:\test\test.txt"

> However, when the patch contains a space I cannot get it
> to work.  This is the command I am trying to execute.

> Shell "c:\program files\Windows NT\Accessories\wordpad.exe
> c:\program files\sfstart.txt", vbMaximizedFocus

> Any help would be greatly appreciated.



Tue, 13 Jul 2004 03:50:54 GMT  
 shell command with space in path/file name does not work
You need to put embedded quote marks around each part of the actual command

Shell """c:\Program Files\Windows NT\Accessories\Wordpad.exe"" ""c:\Program
Files\sfstart.txt""", vbMaximizedFocus

--
Mike Ober.


Quote:
> I am trying to use the shell command to start wordpad and
> then load a text file.  It works fine if the path does not
> have a space for example: "c:\test\test.txt"

> However, when the patch contains a space I cannot get it
> to work.  This is the command I am trying to execute.

> Shell "c:\program files\Windows NT\Accessories\wordpad.exe
> c:\program files\sfstart.txt", vbMaximizedFocus

> Any help would be greatly appreciated.



Tue, 13 Jul 2004 05:33:42 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. shell command with space in path/file name does not work

2. Space in Path Name passed in as command line argument

3. Passing a file path with spaces to Shell function

4. Shell to Word '97 problem - spaces in file name

5. Bad Command or File name when Shelling DOS Batch File

6. Kill/Name function don't work after shell commands

7. Shell command not working...Please help

8. Shell command not working...NEED HELP!!!!

9. Shell command not working

10. Shell (start xxxxx) not working for full Windows-path directory files (works for 8-character directory paths)

11. File Association Not Passing Long File Names to Command$

12. Shell Word with command line file name problem

 

 
Powered by phpBB® Forum Software