Hi,
Does anyone know of a way to remotely shut down a computer on a LAN? For that matter, how do I shut down the computer I am currently wouking on through C++ as well?
Well, to my limited knowledge it's impossible to send a LAN command doing that. You could however have some program (client-server type) catching a command to a certain port and interpete it. One of the commands possible could be to make a shut-down.
This would in effect be a trojan-horse program and should be used with extreme caution but i can see a purpose in a LAN, it could even be a LAN-messaging program and such.
hi there,
there are many ways to manipulate other programs to shutdown the remote computer for u.for example,you can use an ftp server (you need to install it first of course...) to execute the shutdown.exe file on system32 directory.
how do u do it?
well,on the ftp server,you need to create a user called "shutdown" (the name is not important) and give him premission to write in a directory that you choose.put an empty txt file in that directory.
every ftp server software has "event configuration".
find it and look for your "favorite event"
(i chose "on renaming file" event).you will see that you can choose a file to execute when this event accures.
choose "shutdown.exe" on system32 directory.
whenever you log on to your ftp with user name "shutdown"
and rename a file that's in there, your ftp server will execute "shutdown.exe" and the remote computer will be shut.
this works great.the only problem is that you need a dns name for your ftp server in order to bypass the need for ip address of the remote computer.
try
Hello,
to shutdown/restart/logoff windows use WinAPI function ExitWindowsEx(...)
But, on WinNT derivatives you must have privileges to execute this, so use AdjustTokenPrivilege(...) function to obtain privileges. You don't need it on Win 95/98/Me.
However, these functions and things surrounding them are too big to describe in one post, so start digging your MSDN/WINSDK
Post again if you have problems with these. I've used this method few times (e.g. to shutdown all machines in network from one place, but you would need your LAN protocol/apps) and it's the only clean/documented way to shut-down a machine.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.