Jump to content

Running Multipule Command Line Commands


Recommended Posts

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

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.

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...