|
| | |||||||
| Windows XP Discuss the Microsoft Windows XP Operating System |
| | LinkBack | Thread Tools |
|
#1
| |||
| |||
| VBS script with spaces in executable path I'm trying to write a vbs to run vncviewer on a relative path. The following code works, except when the path has spaces: Dim LaunchDir, FSO, WSHShell Set FSO = CreateObject("Scripting.FileSystemObject") Set WSHShell = WScript.CreateObject("WScript.Shell") LaunchDir = FSO.GetFolder(".") wSHShell.Run LaunchDir & "\vncviewer.exe -notoolbar -autoscaling myhost.dyndns.org" Where's the error? Any help would be appreciated. |
| |
|
#2
| |||
| |||
| Re: VBS script with spaces in executable path From: "Tyler Durden" <abuse@antispam.org> | I'm trying to write a vbs to run vncviewer on a relative path. The following | code works, except when the path has spaces: | Dim LaunchDir, FSO, WSHShell | Set FSO = CreateObject("Scripting.FileSystemObject") | Set WSHShell = WScript.CreateObject("WScript.Shell") | LaunchDir = FSO.GetFolder(".") | wSHShell.Run LaunchDir & "\vncviewer.exe -notoolbar -autoscaling | myhost.dyndns.org" | Where's the error? | Any help would be appreciated. I suggest asking here... microsoft.public.windows.server.scripting -- Dave http://www.claymania.com/removal-trojan-adware.html Multi-AV - http://www.pctipp.ch/downloads/dl/35905.asp |
|
#3
| |||
| |||
| Re: VBS script with spaces in executable path Path with spaces should be in quotes. So, modify Your last code row: wSHShell.Run """" & LaunchDir & "\vncviewer.exe" & """" & " -notoolbar -autoscaling myhost.dyndns.org" Something like this, if I wasn't mistaken... Tyler Durden wrote: > I'm trying to write a vbs to run vncviewer on a relative path. The following > code works, except when the path has spaces: > > Dim LaunchDir, FSO, WSHShell > Set FSO = CreateObject("Scripting.FileSystemObject") > Set WSHShell = WScript.CreateObject("WScript.Shell") > LaunchDir = FSO.GetFolder(".") > > wSHShell.Run LaunchDir & "\vncviewer.exe -notoolbar -autoscaling > myhost.dyndns.org" > > Where's the error? > Any help would be appreciated. > > |
|
#4
| |||
| |||
| Re: VBS script with spaces in executable path > I'm trying to write a vbs to run vncviewer on a relative path. The > following code works, except when the path has spaces: > > Dim LaunchDir, FSO, WSHShell > Set FSO = CreateObject("Scripting.FileSystemObject") > Set WSHShell = WScript.CreateObject("WScript.Shell") > LaunchDir = FSO.GetFolder(".") > > wSHShell.Run LaunchDir & "\vncviewer.exe -notoolbar -autoscaling > myhost.dyndns.org" > > Where's the error? > Any help would be appreciated. Put quotes around the paths. e.g. "c:\path\...\...\" Then it sees the entire path, not just part of it. |
| Bookmarks |
| Thread Tools | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| file path spaces | Boliver | Microsoft Office | 5 | 02-07-2008 10:41 AM |
| An executable file to run a VB script? | Zakynthos | Windows XP | 3 | 08-10-2007 05:30 AM |
| executable for cmd not in path? | Dick Watson | Windows XP | 8 | 03-05-2007 03:30 PM |
| files with spaces in the full path | analyst41@hotmail.com | Windows XP | 3 | 01-13-2007 12:00 PM |
| How to link to local file in OneNote when path contains spaces? | Paula | Microsoft OneNote | 1 | 01-06-2007 11:17 PM |
| New To Technology Questions? | Do You Need Help with Your Computer or Device? | Do You Need Help with this site? |