Hi there
I'm calling an exe via powershell using the Invoke command and i seem to get error one machine and not the other. The only difference i can see is the Program Files path
This works
Invoke-command -computername $server -ScriptBlock `
{ write-host "Server : $env:computername"
& "C:\Program Files\APPS\Desk Move Watch Service\DeskMoveWatchService.exe"
$wshell = New-Object -ComObject wscript.shell;
$wshell.AppActivate('Apps.Systems.DeskMoveWatchService')
Sleep 1
$wshell.SendKeys('~')
} -credential $cred -erroraction 'stop'
---------------------------------------------------------------------------------------------------------------
But this doesn't
Invoke-command -computername $server -ScriptBlock `
{ write-host "Server : $env:computername"
& "C:\Program Files (x86)\APPS\Desk Move Watch Service\DeskMoveWatchService.exe"
$wshell = New-Object -ComObject wscript.shell;
$wshell.AppActivate('Apps.Systems.DeskMoveWatchService')
Sleep 1
$wshell.SendKeys('~')
} -credential $cred -erroraction 'stop'
Please could anyone share some advise