Author Posts

August 15, 2013 at 5:17 am

Dear all,

I have to start a process remotely with login as console like:
mstsc /admin or /console, then "start myprogram.exe GP01"

I have powershell V2, I tried with: invoke-command and
invoke-wmimethod but same.
Any one has any idea?
Thanks.

August 15, 2013 at 7:00 am

You need to share what you ran and what the results you received were in here in order for someone to be able to help you. Otherwise you're leaving us in the dark.

August 16, 2013 at 10:27 am

Good day everybody,

Ok Posholic,

I ran: invoke-command -computername server1 {start c:\myprocess GP1} nothing

also invoke-wmimethod -path win32_process -name create -argumentlist {start c:\myprocess GP1}

I got nothing with Returnvalue: 9

Just I need to run this command on console session not any session created, like when I logon with: mstsc /console

Also when I logon on this server with mstsc /admin, and I execute this with powershell:
start c:\myprocess GP1

It runs perfectly

Just for reminder I have powershell V2.

I know it weird but this program should start in console session and not in other session.

Thanks for your help

August 16, 2013 at 11:41 am

As far as I know, this isn't possible with PowerShell remoting, but you might be able to make it work with PSExec, which you can download from Microsoft if you don't have it already. PSExec's "-i" argument with no session specified is supposed to make the command interact with the console session. I haven't tested this syntax, but the command would probably look something like this:

psexec.exe \\server1 -i powershell.exe -Command start c:\myprocess GP1

August 16, 2013 at 11:45 am

Ok Dave thanks,

I will try and revert back to you.

August 18, 2013 at 3:48 am

Hi Dave,

I tried this from my workstation:

psexec \\Myserver -i powershell -command start "E:\STARTUP\StartNStopFiles\SyncDB_recover" -WindowStyle minimized -ArgumentList GP01

But it doesn't work, same as powershell, process is being executed but I don't see the windows in console screen.

Thanks for your suggestion