emmanuel Posted April 28, 2004 Posted April 28, 2004 Dear dudes and dudettes of much esteam, what am I missing? I've tried it two ways: Run("\\server\share\file.Vbs") RunWait(@ComSpec & " /c " & "\\server\share\file.Vbs") neither one works, though it seems as though either of them should... it seemed that I should be able to make it work by runningRunWait(@ComSpec & " /c " & "cscript.exe \\server\share\file.Vbs") then I figured it out. and since I've already typed all this, I'm going to post it. RunWait(@ComSpec & " /c " & 'cscript.exe "\\server\share\file.Vbs"') "I'm not even supposed to be here today!" -Dante (Hicks)
emmanuel Posted April 28, 2004 Author Posted April 28, 2004 It's Windows 2000, and there's a space in the file path, so that needs to be in quotes... and I'm getting an invalid directory error... Run(@ComSpec & ' /s start "" "\\server\share\dir name\file.Vbs"') (wouldn't I want this to be RunWait? "I'm not even supposed to be here today!" -Dante (Hicks)
emmanuel Posted April 28, 2004 Author Posted April 28, 2004 (edited) start /w "" "\\server\share\dir folder\file.vbs" works from the command prompt, but RunWait(@ComSpec & '/s start /w "" "\\server\share\dir folder\file.vbs"') doesn't work from autoit. Error message --------------------------- AutoIt Error --------------------------- Line 42 (File "\\spseprt1\windist\ITProcedures\autoit\cgp_install_src\Install CGP for DR.au3"): RunWait(@ComSpec & '/s start /w "" "\\spseprt1\windist\ITProcedures\Application Setups\ETS Gas Install\CGP6.1.14\GMS.Vbs"') Error: Unable to execute the external program. The system cannot find the path specified. --------------------------- OK --------------------------- Edited April 28, 2004 by emmanuel "I'm not even supposed to be here today!" -Dante (Hicks)
ezzetabi Posted April 29, 2004 Posted April 29, 2004 but it is having a problem finding @comspec I imagine. This seems weird...Not too much Lar. It happens often in W9x systems upgraded to W2000, the SO still rember the %comspec% value as Win98 did (command.com) instead of the new cmd.exe
emmanuel Posted April 29, 2004 Author Posted April 29, 2004 will doublecheck it... just wanted to say this is on XP, freshly loaded. --- ps, yeah, Opera rules. "I'm not even supposed to be here today!" -Dante (Hicks)
emmanuel Posted April 29, 2004 Author Posted April 29, 2004 from the command prompt %comspec% finds cmd.com like it should.I ran the whole %comspec% /c start /w "\\server\share\file.vbs" from the command prompt and it works... still doesn't work with the .au3 script.once more, here's the code in my script RunWait(@ComSpec & '/c start /w "" "\\server\share\folder\file.Vbs"')which works from cmd prompt, but not the script...... "I'm not even supposed to be here today!" -Dante (Hicks)
Todd Bauer Posted April 30, 2004 Posted April 30, 2004 I think you need liberal use of double-double quotes. Here is a sample of some of my junk... RunWait(@ComSpec & " /c copy /Y /D ""C:\Vulnerable\DataPersistent\*.*"" K:\archive\DataPersistentBackup","",@SW_HIDE)
emmanuel Posted April 30, 2004 Author Posted April 30, 2004 --------------------------- AutoIt Error --------------------------- Line 40 (File "\\spseprt1\windist\ITProcedures\autoit\cgp_install_src\Install CGP for DR.au3"): RunWait(@ComSpec & " /c start /w " & '"\\spseprt1\windist\ITProcedures\Application Setups\ETS Gas Install\CGP6.1.14\GMS.Vbs"') Error: Unable to execute the external program. The directory name is invalid. --------------------------- OK --------------------------- I don't get it. the directory is valid, I can paste that same line into a run or do it from cmd and it works. :iamstupid: "I'm not even supposed to be here today!" -Dante (Hicks)
ezzetabi Posted April 30, 2004 Posted April 30, 2004 TryRunWait(@ComSpec & " /c start /w "" "\\spseprt1\windist\ITProcedures\Application Setups\ETS Gas Install\CGP6.1.14\GMS.Vbs"','')
emmanuel Posted April 30, 2004 Author Posted April 30, 2004 TryRunWait(@ComSpec & " /c start /w "" "\\spseprt1\windist\ITProcedures\Application Setups\ETS Gas Install\CGP6.1.14\GMS.Vbs"','')negatory---------------------------AutoIt Error---------------------------Line 41 (File "\\spseprt1\windist\ITProcedures\autoit\cgp_install_src\Install CGP for DR.au3"):RunWait(@ComSpec & " /c start /w "" "\\spseprt1\windist\ITProcedures\Application Setups\ETS Gas Install\CGP6.1.14\GMS.Vbs"','')RunWait(@ComSpec & " /c start /w "" "^ ERRORError: Unable to parse line.---------------------------OK --------------------------- "I'm not even supposed to be here today!" -Dante (Hicks)
emmanuel Posted April 30, 2004 Author Posted April 30, 2004 what happens with this?RunWait(@ComSpec & " /c ")Lar.add pieces of the string and see what happens...Lar.RunWait(@ComSpec & " /c ")got me a quick flash of a dos window.RunWait(@ComSpec & " /c start ")gets me the invalid path error. where is start located? Should I try putting in a full path to it? (using vars of course)thank you Lar. "I'm not even supposed to be here today!" -Dante (Hicks)
emmanuel Posted April 30, 2004 Author Posted April 30, 2004 got same path not found error with your comspec line, so tried set of code, that got this error. --------------------------- AutoIt Error --------------------------- Line 45 (File "\\spseprt1\windist\ITProcedures\autoit\cgp_install_src\Install CGP for DR.au3"): RunWait($run & ' "\\spseprt1\windist\ITProcedures\Application Setups\ETS Gas Install\CGP6.1.14\GMS.Vbs"') Error: Unable to execute the external program. The system cannot find the file specified. --------------------------- OK --------------------------- I went and checked the value of that key in the reg and it's: %SystemRoot%\System32\WScript.exe "%1" %* so, if I'm trying to figure out what the line of code starting "If StringInStr(" does, but I'm not sure if I'm getting it. Is it just removing any possible spaces from the begining of the $run value? "I'm not even supposed to be here today!" -Dante (Hicks)
emmanuel Posted April 30, 2004 Author Posted April 30, 2004 ahhh... I was confused by what the helpfile says about what stringleft does, or perhaps it's just the way that I'm not familiar with the more intricate methods of doing what you do... anyways, I put in a msgbox to make sure that $run is as it should be before going to the command. and still having this problem popup. --------------------------- AutoIt Error --------------------------- Line 46 (File "\\spseprt1\windist\ITProcedures\autoit\cgp_install_src\Install CGP for DR.au3"): RunWait($run & ' "\\spseprt1\windist\ITProcedures\Application Setups\ETS Gas Install\CGP6.1.14\GMS.Vbs"') Error: Unable to execute the external program. The system cannot find the file specified. --------------------------- OK --------------------------- for grins, I've copied gms.vbs to c:\ to test my "long files with spaces suck" theory that's developing... :twitch: still happens --------------------------- AutoIt Error --------------------------- Line 46 (File "\\spseprt1\windist\ITProcedures\autoit\cgp_install_src\Install CGP for DR.au3"): RunWait($run & ' "c:\GMS.Vbs"') Error: Unable to execute the external program. The system cannot find the file specified. --------------------------- OK --------------------------- and with only RunWait($run) --------------------------- AutoIt Error --------------------------- Line 46 (File "\\spseprt1\windist\ITProcedures\autoit\cgp_install_src\Install CGP for DR.au3"): RunWait($run) Error: Unable to execute the external program. The system cannot find the file specified. --------------------------- OK --------------------------- "I'm not even supposed to be here today!" -Dante (Hicks)
emmanuel Posted April 30, 2004 Author Posted April 30, 2004 yet another thing I tried, ran from windows run window: %systemroot%\system32\wscript.exe "c:\gms.vbs" and it worked... "I'm not even supposed to be here today!" -Dante (Hicks)
emmanuel Posted April 30, 2004 Author Posted April 30, 2004 yeah, I'm using RunAsSet("administrator", @computername, "passwrd" ) "I'm not even supposed to be here today!" -Dante (Hicks)
emmanuel Posted April 30, 2004 Author Posted April 30, 2004 but I just rem'd that out and it still err'd "I'm not even supposed to be here today!" -Dante (Hicks)
emmanuel Posted May 3, 2004 Author Posted May 3, 2004 so, no more ideas? no one else had problems running vbs from autoit? "I'm not even supposed to be here today!" -Dante (Hicks)
Administrators Jon Posted May 3, 2004 Administrators Posted May 3, 2004 I am missing the problem here When I run a vbs file I just do: RunWait('cscript.exe "c:\long file\name\script.vbs"') (notice the use of single and double quotes) And that's it. Or I use wscript.exe instead of cscript. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
Lilla Posted May 3, 2004 Posted May 3, 2004 I am missing the problem here When I run a vbs file I just do:RunWait('cscript.exe "c:\long file\name\script.vbs"')(notice the use of single and double quotes)And that's it. Or I use wscript.exe instead of cscript.Jon, thanks. I didn't know about cscript.exe/wscript.exe I was using Comspec. I've now replaced it with cscript.exe and it works great here.Lilla
emmanuel Posted May 3, 2004 Author Posted May 3, 2004 ok, that was the long way around... don't know why it was I thought that wasn't the best way to do it, but it works, so don't mess with it, right? "I'm not even supposed to be here today!" -Dante (Hicks)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now