Frutarom IT
asked on
Run Bat File on Remote Computer - PSExec
Why am I getting access denied when entering this through PSExec in my C# program
I have the same code, minus the path being different... the Path IS valid, and have used it on other programs before.
Here is my .bat file
I am trying to make even a simple one work, and even this is giving me access is denied.
string ip = getIP();
string scope = @"-accepteula -d -i \\" + ip + @" -u frutarom\" + textBox2.Text + " -p " + textBox3.Text + " cmd /c " + @" \\njfs01\public\testing\bat files\IP Release-Renew.bat";
ProcessStartInfo info = new ProcessStartInfo("psexec.exe", scope);
info.UseShellExecute = false;
Process p = Process.Start(info);
I have the same code, minus the path being different... the Path IS valid, and have used it on other programs before.
Here is my .bat file
Start-Process powershell -Verb runAs
ipconfig /all
TIMEOUT /t 40
I am trying to make even a simple one work, and even this is giving me access is denied.
Are you an admin on the target machine?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.