![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | How to execute external program from powershell Hi, Can someone show me how to execute an external program using powershell script? say: $strFolderSource = "\\devserver1\downloads" $strFolderTarget = "\\devserver1\downloads" $strCmd = "robocopy /S " + $strFolderSource + " " + $strFolderTarget I need to execute $strCmd. TIA |
My System Specs![]() |
| | #2 (permalink) |
| | Re: How to execute external program from powershell On May 16, 8:50*pm, "Danny Ni" <d...@xxxxxx> wrote: Quote: > Hi, > > Can someone show me how to execute an external program using powershell > script? say: > > $strFolderSource = "\\devserver1\downloads" > $strFolderTarget = "\\devserver1\downloads" > $strCmd = "robocopy /S " + $strFolderSource + " " + *$strFolderTarget > > I need to execute $strCmd. > > TIA [system.diagnostics.process]::start($strCmd) or if you're using v2, use the Start-Process cmdlet. Here's the MSDN article on the method: http://msdn.microsoft.com/en-us/libr...ess.start.aspx |
My System Specs![]() |
| | #3 (permalink) |
| | Re: How to execute external program from powershell mm..looks like you need this: Invoke-Expression $strCMD -- WBR, Vadims Podans MVP: PowerShell PowerShell blog - www.sysadmins.lv "Danny Ni" <dndn@xxxxxx> rakstija zinojuma "news:OMNNpKq1JHA.480@xxxxxx"... Quote: > Hi, > > Can someone show me how to execute an external program using powershell > script? say: > > $strFolderSource = "\\devserver1\downloads" > $strFolderTarget = "\\devserver1\downloads" > $strCmd = "robocopy /S " + $strFolderSource + " " + $strFolderTarget > > I need to execute $strCmd. > > TIA > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: How to execute external program from powershell Hi Danny, You can also try with the call operator (i.e "&"): & robocopy /S $strFolderSource $strFolderTarget --- Shay Levy Windows PowerShell MVP http://blogs.microsoft.co.il/blogs/ScriptFanatic PowerShell Toolbar: http://tinyurl.com/PSToolbar DN> Hi, DN> DN> Can someone show me how to execute an external program using DN> powershell script? say: DN> DN> $strFolderSource = "\\devserver1\downloads" DN> $strFolderTarget = "\\devserver1\downloads" DN> $strCmd = "robocopy /S " + $strFolderSource + " " + DN> $strFolderTarget DN> I need to execute $strCmd. DN> DN> TIA DN> |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Can only execute gpg from powershell under MY account | PowerShell | |||
| How to execute a webtest from Powershell | PowerShell | |||
| Powershell Execute process | PowerShell | |||
| passing parameters to an external program using PowerShell variables | PowerShell | |||
| How to execute (perl) scripts in Powershell without DOS box | PowerShell | |||