I have used the code posted on link Execute exe on remote machine
and changed notepad location on the line
info.Arguments = @"\\" + serverName + @" -i C:\WINDOWS\System32\notepad.exe";
,but still throws error like
"The system cannot find the file specified" ,any idea why this error is causing.My destination system is windows 2008 R2 server
Asked
Active
Viewed 91 times
0

peter
- 8,158
- 21
- 66
- 119
-
Is PsExec installed on the remote system? – 500 - Internal Server Error Jun 06 '18 at 09:40
-
You don't need that code to run programs remotely. A simple `Enter-PSSession servername` in Powershell is enough to start a new session wihtout installing `psexec` or anything else. You can create a remote Powershell pipeline in code very easily as well – Panagiotis Kanavos Jun 06 '18 at 09:40
-
@Panagiotis Kanavos how to do it?? – peter Jun 06 '18 at 09:45
-
@500 - Internal Server Error how to know psexec is installed on remote server – peter Jun 06 '18 at 09:45
-
1Well, if you install it then you'll know it's there... – 500 - Internal Server Error Jun 06 '18 at 09:50
-
To clarify, PsExec is a utility - it's not part of a standard Windows installation. – 500 - Internal Server Error Jun 06 '18 at 09:59
-
I installed psexec,now no error coming ,but notepad is not opening remotely – peter Jun 06 '18 at 10:20
-
i have persmission issue ,which i will solve – peter Jun 06 '18 at 11:46
1 Answers
1
There are two notepad.exe available in "C:\"
- In Windows directory like "c:\Windows\notepad.exe"
- In System32 directory like "c:\Windows\System32\notepad.exe"
If you want to access notepad.exe in the System32 directory then you want administrator credentials.
Suggestion: use "c:\Windows\notepad.exe" this one.

AustinWBryan
- 3,249
- 3
- 24
- 42

Niteen
- 121
- 13