zeno Posted September 29, 2005 Share Posted September 29, 2005 Hi........ I'm working on launching a VBScript from within an AutoIT file. This is b/c Vbs doesn't have a blockinput function I can use. Therefore what I'm trying to do is have an AutoIT file do the inputblock for me and then within the autoIT call the vbscript that does some other things for me. However I can't seem to get it to work.... My actual script is as below BlockInput(1) run("c:\temp\testscript.vbs", "", @SW_HIDE) But it doesn't seem to work.... whats the actual proper way of launching a vbs from an autoIT script..... Please help..... Zeno Link to comment Share on other sites More sharing options...
drak Posted September 29, 2005 Share Posted September 29, 2005 you have 2 methods for working with VBS, the first is by: 1. run(@Comspec & " /c cscript.exe c:\temp\testscript.vbs", "", @SW_HIDE) 2. you can download the latest beta & run vbscript from within Autoit look into the COM objects option 1 should get you out of trouble but option 2 maybe the way to go in the future Link to comment Share on other sites More sharing options...
zeno Posted September 29, 2005 Author Share Posted September 29, 2005 Thanks for the reply........ that did the job......... However another thing.........how can I blockinput() while the vbs script is running. B/c I'm actually using VBS to install some software and I would like to disable input during that time hence the reason I'm calling a vbs from within autoit. The code I use now is SplashTextOn("Blocking keys") Blockinput(1) run(@Comspec & " /c cscript.exe c:\script.vbs", "", @SW_HIDE) SplashOff() Blockinput(0) Can this be done..........? Cheers Link to comment Share on other sites More sharing options...
Confuzzled Posted September 29, 2005 Share Posted September 29, 2005 Would RunWait do the job? Link to comment Share on other sites More sharing options...
zeno Posted September 29, 2005 Author Share Posted September 29, 2005 Tried that......... It doesn't work....... Link to comment Share on other sites More sharing options...
MHz Posted September 29, 2005 Share Posted September 29, 2005 (edited) you have 2 methods for working with VBS, the first is by:1.run(@Comspec & " /c cscript.exe c:\temp\testscript.vbs", "", @SW_HIDE)2. you can download the latest beta & run vbscript from within Autoitlook into the COM objectsoption 1 should get you out of trouble but option 2 maybe the way to go in the future3. Windows Scripting Host.RunWait('wscript.exe "c:\temp\testscript.vbs"') Edited September 29, 2005 by MHz Link to comment Share on other sites More sharing options...
zeno Posted September 30, 2005 Author Share Posted September 30, 2005 One more question...... How do I include spaces for the path..... b/c i have this script residing here C:\Program Files\Common Files\PWC\Wiz-Kit\Installscripts and it doesn't seem to be executing properly.....with the following command runwait(@Comspec & " /c cscript.exe C:\Program Files\Common Files\PWC\Wiz-Kit\Installscripts\ToolbxCleanup.vbs", "", @SW_HIDE) I tried placing " " within the path but that didn't seem to work......... Thanks..... Link to comment Share on other sites More sharing options...
LxP Posted September 30, 2005 Share Posted September 30, 2005 If you wrap an AutoIt string in single quotes, you can then use double quotes within it: runWait(@comSpec & ' /c cscript.exe "C:\Program Files\Common Files\PWC\Wiz-Kit\Installscripts\ToolbxCleanup.vbs"', '', @SW_HIDE) Link to comment Share on other sites More sharing options...
zeno Posted September 30, 2005 Author Share Posted September 30, 2005 Great............ That did the job.............. Thanks........... Link to comment Share on other sites More sharing options...
cmccarty Posted May 5, 2010 Share Posted May 5, 2010 If you wrap an AutoIt string in single quotes, you can then use double quotes within it: runWait(@comSpec & ' /c cscript.exe "C:\Program Files\Common Files\PWC\Wiz-Kit\Installscripts\ToolbxCleanup.vbs"', '', @SW_HIDE) I am trying to use the code given here to call a vbs script that I am working with. It calls the vbs script just fine, but I need to be using a RunAs so the vbs script is being run as an administrator. As soon as I add RunAs, the script stops working. Can you help? Link to comment Share on other sites More sharing options...
wolf9228 Posted May 5, 2010 Share Posted May 5, 2010 (edited) Hi........I'm working on launching a VBScript from within an AutoIT file. This is b/c Vbs doesn't have a blockinput function I can use.Therefore what I'm trying to do is have an AutoIT file do the inputblock for me and then within the autoIT call the vbscript that does some other things for me. However I can't seem to get it to work....My actual script is as belowBlockInput(1)run("c:\temp\testscript.vbs", "", @SW_HIDE) But it doesn't seem to work.... whats the actual proper way of launching a vbs from an autoIT script.....Please help.....Zeno...\AutoIt3\AutoItX\ActiveX\VBScriptShellExecute("calculator.vbs") Edited May 5, 2010 by wolf9228 صرح السماء كان هنا Link to comment Share on other sites More sharing options...
GEOSoft Posted May 5, 2010 Share Posted May 5, 2010 If you use AutoItX, which is an ActiveX version of AutoIt then you can call the BlockInput from within the VBS. all you have to do is create the AutoItX as an object.For an explicit example see the last post on this page, by our old buddy torgeir George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted May 5, 2010 Share Posted May 5, 2010 I am trying to use the code given here to call a vbs script that I am working with. It calls the vbs script just fine, but I need to be using a RunAs so the vbs script is being run as an administrator. As soon as I add RunAs, the script stops working.Can you help?Hi and Welcome to the forums!We are not mind-readers. Show some code of we can't do anything. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
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