Jonniemac315 Posted June 10, 2009 Share Posted June 10, 2009 I am trying to run 2 commands in the command line and running into an issue because they need to run in the same window. I need to run the first command wait till it finishes and then run the second command. Below is my script any help is greatly appreciated. $Computer = @ComputerName Run(@ComSpec & " /c " & 'csccmd /enable', "", @SW_HIDE) Run(@ComSpec & " /c " & 'csccmd /extract /target:\\Storage-server\Data\' & $computer & ' /recurse', "") Link to comment Share on other sites More sharing options...
gcue Posted June 10, 2009 Share Posted June 10, 2009 have u tried runwait? Link to comment Share on other sites More sharing options...
Jonniemac315 Posted June 10, 2009 Author Share Posted June 10, 2009 have u tried runwait?What I realy need to do is thisOpen Command Prompt'csccmd /enable' {enter}'csccmd /extract /target:\\Storage-server\Data\' & $computer & ' /recurse' {enter}Close Command PromptAll hidden. I guess I should have explained better. Link to comment Share on other sites More sharing options...
zorphnog Posted June 10, 2009 Share Posted June 10, 2009 (edited) To restate what gcue said, have you tried runwait? $Computer = @ComputerName RunWait(@ComSpec & " /c " & 'csccmd /enable', "") RunWait(@ComSpec & " /c " & 'csccmd /extract /target:\\Storage-server\Data\' & $computer & ' /recurse', "")oÝ÷ Øêâ*.Á©í¶¦¶î)íëç&w§v%¡Æ¥z{â®æz{oj¸nW¬±ë[Ë÷§i¹^jëh×6$Computer = @ComputerName RunWait(@ComSpec & " /c " & 'csccmd /enable & csccmd /extract /target:\\Storage-server\Data\' & $computer & ' /recurse', "") Edited June 10, 2009 by zorphnog 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