Problem with running an exe from a form
Posted: Fri Jun 15, 2012 8:45 am
Problem with running an exe from a form.
Here is my function:
Function Command($strComputer) {
if (Test-Port135($strComputer)) {
If (Test-Path $strComputerE$scriptsIIS7EnAble-redirection.js ){
e:scriptspsexec.exe -d -h $stComputer wscript E:scriptsIIS7EnAble-redirection.js
e:scriptsPSService.exe $strComputer restart wmsvc
}
Else {
$statusbar1.Text = $strComputer.Text
robocopy E:scriptsIIS7 "" + $strComputer + "E$scriptsIIS7 *.js"
e:scriptspsexec.exe -d -h $stComputer wscript E:scriptsIIS7EnAble-redirection.js
e:scriptsPSService.exe $strComputer restart wmsvc
}
}
}
The PSService gives me this error:
PSService.exe :
Shared-Config.pff (159): ERROR: At Line: 159 char: 30
ERROR: + e:scriptsPSService.exe <<<< $strComputer restart wmsvc
ERROR: + CategoryInfo : NotSpecified: (:String) [], RemoteException
ERROR: + FullyQualifiedErrorId : NativeCommandError
It does not appear to be picking up the $strComputer variable. I am also having trouble getting the $strComputer variable to show up in the $statusbar1.Text = $strComputer.
The odd thing is that e:scriptspsexec.exe -d -h $stComputer wscript E:scriptsIIS7EnAble-redirection.js runs fine.
Any ideas?MFelkins2012-06-15 15:51:08