❔ how to turn off computer 1 from computer 2 with his ip and connected to the same network
hello how do i shutdown a computer remotly with ip?
shutdown /m \{IP}/s /t 3 thats what im doing in cmd but when i try do the same in c# it doesnt work
23 Replies
What are you making?
what do you mean "do the same in C#"?
do that how?
im making an office computer manager
okay so this command will shutdown the computer right
if you say so
and im trying to open the cmd print that and make it shutdown the computer
i tried chatgpt but it was not working
you said you are doing "the same in C#"
how?
oh well nvm
i try to make the cmd open in c#
and then pass all data
yes
how
how are you doing this?
what about this isn't working?
Process process = new Process();
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.Arguments = $"/c shutdown /m \\{ip} /s /t 3";
process.Start();
thats how i do that
and what's not working about that?
well its not turning off the computer xd
i dont get any c# errors its just not working
no errors or anything?
just silent failure?
yep
k
well, for starters, what you posted is in-fact not the command to shutdown a remote computer
according to the docs it's
wait i dont need ip?
you need
<computername>
which isn't explicitly documented on what values it can be
but presumably, yes, it could be an IP
or a hostname
or a URLits weird because it worked when i did it in cmd
the next question would be "what permissions is this program running with?"
non admin
does it need it?
it needs whatever permissions are needed to run the command
so, yeah
shit lol
i thought it wont need it because its just passing some letters into cmd
sadly i dont have second computer rn
well thanks!
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.