Dragonsys Posted June 20, 2012 Share Posted June 20, 2012 Is it possible to have WPI run a script during the Execute after phase, and not wait for the script/cmd to complete? Link to comment Share on other sites More sharing options...
myselfidem Posted June 20, 2012 Share Posted June 20, 2012 Is it possible to have WPI run a script during the Execute after phase,Yes. and not wait for the script/cmd to complete?Why don't wait the cmd isexecuted? Link to comment Share on other sites More sharing options...
Dragonsys Posted June 20, 2012 Author Share Posted June 20, 2012 Is it possible to have WPI run a script during the Execute after phase,Yes. and not wait for the script/cmd to complete?Why don't wait the cmd isexecuted?I know i can use Execute after, which I am doing, but I need WPI to exit and not wait for the script to complete.The reason why, is I have a script which prompts to run another set of WPI (different confg file), it prompts yes or NoIf yes, it runs WPI, if No it just exitsIf WPI is still running when you select Yes, then you get an error about multiple copies of WPI running at once.So I need WPI to run the script, and then exit, so if Yes is chosen, then the new run of WPI can start up without error. Link to comment Share on other sites More sharing options...
myselfidem Posted June 20, 2012 Share Posted June 20, 2012 (edited) I know i can use Execute after, which I am doing, but I need WPI to exit and not wait for the script to complete.The reason why, is I have a script which prompts to run another set of WPI (different confg file), it prompts yes or NoWhy not ask the question directly?Maybe you can attach your command?I don't know if it's possible to do like you want. Edited June 20, 2012 by myselfidem Link to comment Share on other sites More sharing options...
Dragonsys Posted June 20, 2012 Author Share Posted June 20, 2012 (edited) This is the script:x = MsgBox("Run WPI Layer 2 Now?",4,"Windows Post Installer Layer 2")If x = "6" Then Return = WshShell.Run ("C:\ImgSW\wpi\WPI.exe options=useroptions_layer2.js config=config_layer2.js",1,TRUE)ElseIf x = "7" Then x = MsgBox("Shutdown this server?",4,"Shutdown") If x = "6" Then Return = WshShell.Run ("CMD /c shutdown /s /t 15",1,FALSE) End IfEnd IfWscript.QuitI would like WPI to run this script, and then exit.I can get around it by using a batch script, but it is ugly and I would really prefer not to do it that way. Edited June 20, 2012 by Dragonsys Link to comment Share on other sites More sharing options...
myselfidem Posted June 20, 2012 Share Posted June 20, 2012 Maybe you can use a vbs script to hide the command batch prompt, like this(example and adapt to your needs):' Hide the batch file (clean.cmd)Set WshShell = WScript.CreateObject("WScript.Shell" ) WshShell.Run "%SystemRoot%\Setup\Scripts\clean.cmd" ,SH_WIDE ,trueHTH Link to comment Share on other sites More sharing options...
Dragonsys Posted June 20, 2012 Author Share Posted June 20, 2012 (edited) Maybe you can use a vbs script to hide the command batch prompt, like this(example and adapt to your needs):' Hide the batch file (clean.cmd)Set WshShell = WScript.CreateObject("WScript.Shell" ) WshShell.Run "%SystemRoot%\Setup\Scripts\clean.cmd" ,SH_WIDE ,trueHTHI'm not worried about showing/hiding the CMD Window, but using 1 script (WPI) to kick off another script (bat file) which kicks off another script (prompt) is just more complicated than it should be.Guess I will just have to do it that way though... thanks for your helpOk, i got around this by adding a sleep to my script. This gives WPI time to exit before the next session is started Edited June 20, 2012 by Dragonsys 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