|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
issue on scripting syntax on x64The following script runs normally on a x32 environment, and end without
finding the exe on a x64. What could be the issue? Dim WSHShell Set WSHShell = CreateObject("WScript.Shell") WSHShell.CurrentDirectory = WScript.ScriptFullName & "\.." WSHShell.CurrentDirectory = WSHShell.CurrentDirectory & "\my_program_folder" WSHShell.Run "my_exe.exe /param1 /param2" Any help would be appreciated. "Tyler Durden" <abuse@antispam.org> wrote in message Have you tried using a fully qualified path for your .exe file, instead of news:Oq7zzeE6JHA.1432@TK2MSFTNGP02.phx.gbl... > The following script runs normally on a x32 environment, and end without > finding the exe on a x64. What could be the issue? > > Dim WSHShell > Set WSHShell = CreateObject("WScript.Shell") > WSHShell.CurrentDirectory = WScript.ScriptFullName & "\.." > WSHShell.CurrentDirectory = WSHShell.CurrentDirectory & > "\my_program_folder" > WSHShell.Run "my_exe.exe /param1 /param2" > > Any help would be appreciated. relying on a working directory that may or may not be correct?
Show quote
Hide quote
"Pegasus [MVP]" <n***@microsoft.com> wrote in message If you are certain the exe is in the specified subfolder of the folder where news:ul8XGkE6JHA.1432@TK2MSFTNGP02.phx.gbl... > > "Tyler Durden" <abuse@antispam.org> wrote in message > news:Oq7zzeE6JHA.1432@TK2MSFTNGP02.phx.gbl... >> The following script runs normally on a x32 environment, and end without >> finding the exe on a x64. What could be the issue? >> >> Dim WSHShell >> Set WSHShell = CreateObject("WScript.Shell") >> WSHShell.CurrentDirectory = WScript.ScriptFullName & "\.." >> WSHShell.CurrentDirectory = WSHShell.CurrentDirectory & >> "\my_program_folder" >> WSHShell.Run "my_exe.exe /param1 /param2" >> >> Any help would be appreciated. > > Have you tried using a fully qualified path for your .exe file, instead of > relying on a working directory that may or may not be correct? > the VBScript is saved, perhaps something similar to this would work better: =========== Dim WSHShell, strCmd Set WSHShell = CreateObject("WScript.Shell") strCmd = "%comspec% /c """ & Wscript.ScriptFullName _ & "\..\my_program_folder\my_exe.exe"" /param1 /param2" Wscript.Echo strCmd WSHShell.Run strCmd, 2 ======== The statement to echo strCmd is for troubleshooting, to make sure the command is correct. Note the path and file name are in quotes, and quotes in a quoted string must be doubled. on x32 still worked fine, could not test it on a x64 yet. would be possible
to do it without cmd.exe? thank you! Show quoteHide quote "Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in message news:%23ECf7vE6JHA.1092@TK2MSFTNGP06.phx.gbl... > > "Pegasus [MVP]" <n***@microsoft.com> wrote in message > news:ul8XGkE6JHA.1432@TK2MSFTNGP02.phx.gbl... >> >> "Tyler Durden" <abuse@antispam.org> wrote in message >> news:Oq7zzeE6JHA.1432@TK2MSFTNGP02.phx.gbl... >>> The following script runs normally on a x32 environment, and end without >>> finding the exe on a x64. What could be the issue? >>> >>> Dim WSHShell >>> Set WSHShell = CreateObject("WScript.Shell") >>> WSHShell.CurrentDirectory = WScript.ScriptFullName & "\.." >>> WSHShell.CurrentDirectory = WSHShell.CurrentDirectory & >>> "\my_program_folder" >>> WSHShell.Run "my_exe.exe /param1 /param2" >>> >>> Any help would be appreciated. >> >> Have you tried using a fully qualified path for your .exe file, instead >> of relying on a working directory that may or may not be correct? >> > > If you are certain the exe is in the specified subfolder of the folder > where the VBScript is saved, perhaps something similar to this would work > better: > =========== > Dim WSHShell, strCmd > > Set WSHShell = CreateObject("WScript.Shell") > strCmd = "%comspec% /c """ & Wscript.ScriptFullName _ > & "\..\my_program_folder\my_exe.exe"" /param1 /param2" > Wscript.Echo strCmd > WSHShell.Run strCmd, 2 > ======== > The statement to echo strCmd is for troubleshooting, to make sure the > command is correct. Note the path and file name are in quotes, and quotes > in a quoted string must be doubled. > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab - http://www.rlmueller.net > -- > > I think most exe program will run fine without using %comspec% /c. In that
case: strCmd = """" & Wscript.ScriptFullName _ & "\..\my_program_folder\my_exe.exe"" /param1 /param2" This still encloses the path/filename in quotes, in case there are any spaces in the path. Show quoteHide quote "Tyler Durden" <abuse@antispam.org> wrote in message news:eGU6K%23V6JHA.2656@TK2MSFTNGP05.phx.gbl... > on x32 still worked fine, could not test it on a x64 yet. would be > possible to do it without cmd.exe? > > thank you! > > "Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in > message news:%23ECf7vE6JHA.1092@TK2MSFTNGP06.phx.gbl... >> >> "Pegasus [MVP]" <n***@microsoft.com> wrote in message >> news:ul8XGkE6JHA.1432@TK2MSFTNGP02.phx.gbl... >>> >>> "Tyler Durden" <abuse@antispam.org> wrote in message >>> news:Oq7zzeE6JHA.1432@TK2MSFTNGP02.phx.gbl... >>>> The following script runs normally on a x32 environment, and end >>>> without finding the exe on a x64. What could be the issue? >>>> >>>> Dim WSHShell >>>> Set WSHShell = CreateObject("WScript.Shell") >>>> WSHShell.CurrentDirectory = WScript.ScriptFullName & "\.." >>>> WSHShell.CurrentDirectory = WSHShell.CurrentDirectory & >>>> "\my_program_folder" >>>> WSHShell.Run "my_exe.exe /param1 /param2" >>>> >>>> Any help would be appreciated. >>> >>> Have you tried using a fully qualified path for your .exe file, instead >>> of relying on a working directory that may or may not be correct? >>> >> >> If you are certain the exe is in the specified subfolder of the folder >> where the VBScript is saved, perhaps something similar to this would work >> better: >> =========== >> Dim WSHShell, strCmd >> >> Set WSHShell = CreateObject("WScript.Shell") >> strCmd = "%comspec% /c """ & Wscript.ScriptFullName _ >> & "\..\my_program_folder\my_exe.exe"" /param1 /param2" >> Wscript.Echo strCmd >> WSHShell.Run strCmd, 2 >> ======== >> The statement to echo strCmd is for troubleshooting, to make sure the >> command is correct. Note the path and file name are in quotes, and quotes >> in a quoted string must be doubled. >> >> -- >> Richard Mueller >> MVP Directory Services >> Hilltop Lab - http://www.rlmueller.net >> -- >> >> > > I'll try and give feedback here.
Show quoteHide quote "Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in message news:%23dIHRSW6JHA.3592@TK2MSFTNGP02.phx.gbl... >I think most exe program will run fine without using %comspec% /c. In that >case: > > strCmd = """" & Wscript.ScriptFullName _ > & "\..\my_program_folder\my_exe.exe"" /param1 /param2" > > This still encloses the path/filename in quotes, in case there are any > spaces in the path. > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab - http://www.rlmueller.net > -- > > "Tyler Durden" <abuse@antispam.org> wrote in message > news:eGU6K%23V6JHA.2656@TK2MSFTNGP05.phx.gbl... >> on x32 still worked fine, could not test it on a x64 yet. would be >> possible to do it without cmd.exe? >> >> thank you! >> >> "Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in >> message news:%23ECf7vE6JHA.1092@TK2MSFTNGP06.phx.gbl... >>> >>> "Pegasus [MVP]" <n***@microsoft.com> wrote in message >>> news:ul8XGkE6JHA.1432@TK2MSFTNGP02.phx.gbl... >>>> >>>> "Tyler Durden" <abuse@antispam.org> wrote in message >>>> news:Oq7zzeE6JHA.1432@TK2MSFTNGP02.phx.gbl... >>>>> The following script runs normally on a x32 environment, and end >>>>> without finding the exe on a x64. What could be the issue? >>>>> >>>>> Dim WSHShell >>>>> Set WSHShell = CreateObject("WScript.Shell") >>>>> WSHShell.CurrentDirectory = WScript.ScriptFullName & "\.." >>>>> WSHShell.CurrentDirectory = WSHShell.CurrentDirectory & >>>>> "\my_program_folder" >>>>> WSHShell.Run "my_exe.exe /param1 /param2" >>>>> >>>>> Any help would be appreciated. >>>> >>>> Have you tried using a fully qualified path for your .exe file, instead >>>> of relying on a working directory that may or may not be correct? >>>> >>> >>> If you are certain the exe is in the specified subfolder of the folder >>> where the VBScript is saved, perhaps something similar to this would >>> work better: >>> =========== >>> Dim WSHShell, strCmd >>> >>> Set WSHShell = CreateObject("WScript.Shell") >>> strCmd = "%comspec% /c """ & Wscript.ScriptFullName _ >>> & "\..\my_program_folder\my_exe.exe"" /param1 /param2" >>> Wscript.Echo strCmd >>> WSHShell.Run strCmd, 2 >>> ======== >>> The statement to echo strCmd is for troubleshooting, to make sure the >>> command is correct. Note the path and file name are in quotes, and >>> quotes in a quoted string must be doubled. >>> >>> -- >>> Richard Mueller >>> MVP Directory Services >>> Hilltop Lab - http://www.rlmueller.net >>> -- >>> >>> >> >> > > the long story:
i was using a 'portable' latest remote desktop (mstsc.exe) that supports /admin, on many client computers without lose time installing it. the problem on x64 was not the vbs (with the command line to the portable mstsc) but in the fact that no matter what command line you use the system will always run his own outdated version 5 x64. since I've not updated it, the command line parameter /admin wasn't accepted. Solved using the old /console, that still works. why don't I use a single rdp file? isn't the shortest to type at command line and in some systems it asks for a confirmation with a security warning. thanks to everyone! Show quoteHide quote "Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in message news:%23dIHRSW6JHA.3592@TK2MSFTNGP02.phx.gbl... >I think most exe program will run fine without using %comspec% /c. In that >case: > > strCmd = """" & Wscript.ScriptFullName _ > & "\..\my_program_folder\my_exe.exe"" /param1 /param2" > > This still encloses the path/filename in quotes, in case there are any > spaces in the path. > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab - http://www.rlmueller.net > -- > > "Tyler Durden" <abuse@antispam.org> wrote in message > news:eGU6K%23V6JHA.2656@TK2MSFTNGP05.phx.gbl... >> on x32 still worked fine, could not test it on a x64 yet. would be >> possible to do it without cmd.exe? >> >> thank you! >> >> "Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in >> message news:%23ECf7vE6JHA.1092@TK2MSFTNGP06.phx.gbl... >>> >>> "Pegasus [MVP]" <n***@microsoft.com> wrote in message >>> news:ul8XGkE6JHA.1432@TK2MSFTNGP02.phx.gbl... >>>> >>>> "Tyler Durden" <abuse@antispam.org> wrote in message >>>> news:Oq7zzeE6JHA.1432@TK2MSFTNGP02.phx.gbl... >>>>> The following script runs normally on a x32 environment, and end >>>>> without finding the exe on a x64. What could be the issue? >>>>> >>>>> Dim WSHShell >>>>> Set WSHShell = CreateObject("WScript.Shell") >>>>> WSHShell.CurrentDirectory = WScript.ScriptFullName & "\.." >>>>> WSHShell.CurrentDirectory = WSHShell.CurrentDirectory & >>>>> "\my_program_folder" >>>>> WSHShell.Run "my_exe.exe /param1 /param2" >>>>> >>>>> Any help would be appreciated. >>>> >>>> Have you tried using a fully qualified path for your .exe file, instead >>>> of relying on a working directory that may or may not be correct? >>>> >>> >>> If you are certain the exe is in the specified subfolder of the folder >>> where the VBScript is saved, perhaps something similar to this would >>> work better: >>> =========== >>> Dim WSHShell, strCmd >>> >>> Set WSHShell = CreateObject("WScript.Shell") >>> strCmd = "%comspec% /c """ & Wscript.ScriptFullName _ >>> & "\..\my_program_folder\my_exe.exe"" /param1 /param2" >>> Wscript.Echo strCmd >>> WSHShell.Run strCmd, 2 >>> ======== >>> The statement to echo strCmd is for troubleshooting, to make sure the >>> command is correct. Note the path and file name are in quotes, and >>> quotes in a quoted string must be doubled. >>> >>> -- >>> Richard Mueller >>> MVP Directory Services >>> Hilltop Lab - http://www.rlmueller.net >>> -- >>> >>> >> >> > >
Show quote
Hide quote
"Tyler Durden" <abuse@antispam.org> wrote in message Why did you chose to hide the name of the executable from this newsgroup, news:%23GVX37t6JHA.1420@TK2MSFTNGP04.phx.gbl... > the long story: > > i was using a 'portable' latest remote desktop (mstsc.exe) that supports > /admin, on many client computers without lose time installing it. the > problem on x64 was not the vbs (with the command line to the portable > mstsc) but in the fact that no matter what command line you use the system > will always run his own outdated version 5 x64. since I've not updated it, > the command line parameter /admin wasn't accepted. Solved using the old > /console, that still works. > > why don't I use a single rdp file? isn't the shortest to type at command > line and in some systems it asks for a confirmation with a security > warning. > > thanks to everyone! calling it "my_exe.exe" instead? If you had been a little less secretive then this issue would have been resolved much more quickly! I didn't exactly choose - mstsc is the long story, just wanted to avoid
that. Show quoteHide quote "Pegasus [MVP]" <n***@microsoft.com> wrote in message news:%23ZRdPBu6JHA.1196@TK2MSFTNGP03.phx.gbl... > > "Tyler Durden" <abuse@antispam.org> wrote in message > news:%23GVX37t6JHA.1420@TK2MSFTNGP04.phx.gbl... >> the long story: >> >> i was using a 'portable' latest remote desktop (mstsc.exe) that supports >> /admin, on many client computers without lose time installing it. the >> problem on x64 was not the vbs (with the command line to the portable >> mstsc) but in the fact that no matter what command line you use the >> system will always run his own outdated version 5 x64. since I've not >> updated it, the command line parameter /admin wasn't accepted. Solved >> using the old /console, that still works. >> >> why don't I use a single rdp file? isn't the shortest to type at command >> line and in some systems it asks for a confirmation with a security >> warning. >> >> thanks to everyone! > > Why did you chose to hide the name of the executable from this newsgroup, > calling it "my_exe.exe" instead? If you had been a little less secretive > then this issue would have been resolved much more quickly! > ....and I'm going back to /admin, just discovered that the /console parameter
is accepted without errors but does not work... I'll have to update remote desktop client on x64 systems. Show quoteHide quote "Pegasus [MVP]" <n***@microsoft.com> wrote in message news:%23ZRdPBu6JHA.1196@TK2MSFTNGP03.phx.gbl... > > "Tyler Durden" <abuse@antispam.org> wrote in message > news:%23GVX37t6JHA.1420@TK2MSFTNGP04.phx.gbl... >> the long story: >> >> i was using a 'portable' latest remote desktop (mstsc.exe) that supports >> /admin, on many client computers without lose time installing it. the >> problem on x64 was not the vbs (with the command line to the portable >> mstsc) but in the fact that no matter what command line you use the >> system will always run his own outdated version 5 x64. since I've not >> updated it, the command line parameter /admin wasn't accepted. Solved >> using the old /console, that still works. >> >> why don't I use a single rdp file? isn't the shortest to type at command >> line and in some systems it asks for a confirmation with a security >> warning. >> >> thanks to everyone! > > Why did you chose to hide the name of the executable from this newsgroup, > calling it "my_exe.exe" instead? If you had been a little less secretive > then this issue would have been resolved much more quickly! > full qualified path is not possible as the app is portable, so drive letter
can change. Show quoteHide quote "Pegasus [MVP]" <n***@microsoft.com> wrote in message news:ul8XGkE6JHA.1432@TK2MSFTNGP02.phx.gbl... > > "Tyler Durden" <abuse@antispam.org> wrote in message > news:Oq7zzeE6JHA.1432@TK2MSFTNGP02.phx.gbl... >> The following script runs normally on a x32 environment, and end without >> finding the exe on a x64. What could be the issue? >> >> Dim WSHShell >> Set WSHShell = CreateObject("WScript.Shell") >> WSHShell.CurrentDirectory = WScript.ScriptFullName & "\.." >> WSHShell.CurrentDirectory = WSHShell.CurrentDirectory & >> "\my_program_folder" >> WSHShell.Run "my_exe.exe /param1 /param2" >> >> Any help would be appreciated. > > Have you tried using a fully qualified path for your .exe file, instead of > relying on a working directory that may or may not be correct? > "Tyler Durden" <abuse@antispam.org> wrote in message That only means you cannot pre-specify what the fully qualified path is. But news:Ou6gV9V6JHA.5180@TK2MSFTNGP04.phx.gbl... > full qualified path is not possible as the app is portable, so drive > letter can change. surely your script can determine what it should be, find the file, and then run it? /Al Show quoteHide quote > "Pegasus [MVP]" <n***@microsoft.com> wrote in message > news:ul8XGkE6JHA.1432@TK2MSFTNGP02.phx.gbl... >> >> "Tyler Durden" <abuse@antispam.org> wrote in message >> news:Oq7zzeE6JHA.1432@TK2MSFTNGP02.phx.gbl... >>> The following script runs normally on a x32 environment, and end without >>> finding the exe on a x64. What could be the issue? >>> >>> Dim WSHShell >>> Set WSHShell = CreateObject("WScript.Shell") >>> WSHShell.CurrentDirectory = WScript.ScriptFullName & "\.." >>> WSHShell.CurrentDirectory = WSHShell.CurrentDirectory & >>> "\my_program_folder" >>> WSHShell.Run "my_exe.exe /param1 /param2" >>> >>> Any help would be appreciated. >> >> Have you tried using a fully qualified path for your .exe file, instead >> of relying on a working directory that may or may not be correct? >> > > That's what I want :)
Show quoteHide quote "Al Dunbar" <aland***@hotmail.com> wrote in message news:%23s$AB3X6JHA.2656@TK2MSFTNGP05.phx.gbl... > > "Tyler Durden" <abuse@antispam.org> wrote in message > news:Ou6gV9V6JHA.5180@TK2MSFTNGP04.phx.gbl... >> full qualified path is not possible as the app is portable, so drive >> letter can change. > > That only means you cannot pre-specify what the fully qualified path is. > But surely your script can determine what it should be, find the file, and > then run it? > > /Al > >> "Pegasus [MVP]" <n***@microsoft.com> wrote in message >> news:ul8XGkE6JHA.1432@TK2MSFTNGP02.phx.gbl... >>> >>> "Tyler Durden" <abuse@antispam.org> wrote in message >>> news:Oq7zzeE6JHA.1432@TK2MSFTNGP02.phx.gbl... >>>> The following script runs normally on a x32 environment, and end >>>> without finding the exe on a x64. What could be the issue? >>>> >>>> Dim WSHShell >>>> Set WSHShell = CreateObject("WScript.Shell") >>>> WSHShell.CurrentDirectory = WScript.ScriptFullName & "\.." >>>> WSHShell.CurrentDirectory = WSHShell.CurrentDirectory & >>>> "\my_program_folder" >>>> WSHShell.Run "my_exe.exe /param1 /param2" >>>> >>>> Any help would be appreciated. >>> >>> Have you tried using a fully qualified path for your .exe file, instead >>> of relying on a working directory that may or may not be correct? >>> >> >> > > > Have you echo'd out WSHShell.CurrentDirectory just to make sure it is where
you think it is? Also do you have "On Error Resume Next" in the script? Show quoteHide quote "Tyler Durden" wrote: > That's what I want :) > > > "Al Dunbar" <aland***@hotmail.com> wrote in message > news:%23s$AB3X6JHA.2656@TK2MSFTNGP05.phx.gbl... > > > > "Tyler Durden" <abuse@antispam.org> wrote in message > > news:Ou6gV9V6JHA.5180@TK2MSFTNGP04.phx.gbl... > >> full qualified path is not possible as the app is portable, so drive > >> letter can change. > > > > That only means you cannot pre-specify what the fully qualified path is. > > But surely your script can determine what it should be, find the file, and > > then run it? > > > > /Al > > > >> "Pegasus [MVP]" <n***@microsoft.com> wrote in message > >> news:ul8XGkE6JHA.1432@TK2MSFTNGP02.phx.gbl... > >>> > >>> "Tyler Durden" <abuse@antispam.org> wrote in message > >>> news:Oq7zzeE6JHA.1432@TK2MSFTNGP02.phx.gbl... > >>>> The following script runs normally on a x32 environment, and end > >>>> without finding the exe on a x64. What could be the issue? > >>>> > >>>> Dim WSHShell > >>>> Set WSHShell = CreateObject("WScript.Shell") > >>>> WSHShell.CurrentDirectory = WScript.ScriptFullName & "\.." > >>>> WSHShell.CurrentDirectory = WSHShell.CurrentDirectory & > >>>> "\my_program_folder" > >>>> WSHShell.Run "my_exe.exe /param1 /param2" > >>>> > >>>> Any help would be appreciated. > >>> > >>> Have you tried using a fully qualified path for your .exe file, instead > >>> of relying on a working directory that may or may not be correct? > >>> > >> > >> > > > > > > > > >
IP "Alternate configuration"
ANN: EditVar/EditV32/EditV64 and Choose/Choose32/Choose64 v2.0 Stop windows service copy data and then start service How to pass parameter from a file (txt/dll) to vbs code Finding password protected files Maximum number of connected users Suppress confirmation prompts How to use variables to map network drive question on USB security adding printer depending on username |
|||||||||||||||||||||||