Login | |
|
 |
RE: Trying my first VB script - run external program - 5/15/2008 8:39:49 AM
|
|
 |
|
| |
Fredledingue
Posts: 337
Score: 0
Joined: 5/9/2005
From:
Status: offline
|
The .run command, let alone a DOS command will never work with white spaces in the path. Use short, DOS compatiible paths like "C:\Progra~1\Microso~1\..."
_____________________________
Fred
|
|
| |
|
|
|
 |
RE: Trying my first VB script - run external program - 5/16/2008 6:06:10 AM
|
|
 |
|
| |
Fredledingue
Posts: 337
Score: 0
Joined: 5/9/2005
From:
Status: offline
|
Example? (always ready to learn)
_____________________________
Fred
|
|
| |
|
|
|
 |
RE: Trying my first VB script - run external program - 5/16/2008 10:23:38 AM
|
|
 |
|
| |
Fredledingue
Posts: 337
Score: 0
Joined: 5/9/2005
From:
Status: offline
|
I didn't know that. Hey I tested and it works! As you see I learn everyday. Yet, most of the reported errors with .run I have seen here came from these white spaces. Using shortpaths remove the white spaces, but adding double quotes is of course simplier. Now, I wonder how to pass parameters to the app in question... oWSH.Run """C:\Program Files\my.EXE"" " & Param '? Will that work? I also don't understand very much this little exercice: Dim sCmd : sCmd = """§P§""" sCmd = Replace( sCmd, "§P§", sPathToDocs ) Why do you do that? ?? [quote="ehvbs"]This method makes putting variable content into a string more lucid. [/quote] ==> ?? ?? ==> That was the only reason why I didn't see that trick in your replies above: I didn't understand anything in your code... Well, if it's to make things more lucid, then it's fine. LOL.
< Message edited by Fredledingue -- 5/16/2008 10:27:01 AM >
_____________________________
Fred
|
|
| |
|
|
|
 |
RE: Trying my first VB script - run external program - 5/17/2008 9:41:10 AM
|
|
 |
|
| |
Fredledingue
Posts: 337
Score: 0
Joined: 5/9/2005
From:
Status: offline
|
I'm realy stunned by this revelation! It even works in a DOS prompt manualy written. I can't believe it. Note that long file name support for DOS (that's what these quote allows in fact) works only in a windows environement. Plain DOS will not work with that. That's why the quote trick is the less documented and the most ignored DOS command.
_____________________________
Fred
|
|
| |
|
|
|
| |
|
|
 |
|
 |
|
|