Sign in to follow this  
Followers 0
Jonniemac315

Running Multipule Command Line Commands

4 posts in this topic

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', "")

Share this post


Link to post
Share on other sites



have u tried runwait?

Share this post


Link to post
Share on other sites

have u tried runwait?

What I realy need to do is this

Open Command Prompt

'csccmd /enable' {enter}

'csccmd /extract /target:\\Storage-server\Data\' & $computer & ' /recurse' {enter}

Close Command Prompt

All hidden. I guess I should have explained better.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by zorphnog

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0