November Posted March 22, 2004 Share Posted March 22, 2004 Hi. Does anybody know who to force a logoff in a remote station? (script running in a machine and shutting down user in remote station) Anay ideas ? Thanx Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
Dev Posted March 22, 2004 Share Posted March 22, 2004 Isnt there a BATCH-command for that? Try type help in CMD, I think you can create a batchfile to logg off a user (not sure). Hope this will help :iamstupid: Link to comment Share on other sites More sharing options...
Helge Posted March 22, 2004 Share Posted March 22, 2004 There is a DOS-command, called Shutdown which I think can do whatyou want...Haven't tested it fully yet though...Or you can do it 100% AutoIt style..You could make a script for the remote station which will shutdownthe computer if a net send-message is receivedWhile 1 Sleep(100) If WinExists("Messenger Service", "shutdown") Then Shutdown(5) EndIf WEndSo in this example you just have to send a net send-message to theremote station and the computer will shutdown..Dos command to send net send-messages :net send REMOTE_STATION "MESSAGE"Good luck ! Link to comment Share on other sites More sharing options...
scriptkitty Posted March 22, 2004 Share Posted March 22, 2004 I like PStools from sysinternals http://www.sysinternals.com/ here is the tool I would use from that: PsShutdown Windows NT/2K/XP does not come with a built-in command-line shutdown command. However, both the Windows NT 4 and Windows 2000 Resource Kits come with shutdown, a program that you can use to shutdown local and remote computers. PsShutdown is a clone of the Resource Kit shutdown tool, providing you the same options and ability to shutdown, and optionally reboot, local and remote Windows NT/2K/XP systems. .... All of the utilities in the PsTools suite work on Windows NT, Windows 2000, Windows XP, and Server 2003 and none of the tools requires any special installation. You don't even need to install any client software on the remote computers at which you target them. Run them by typing their name and any command-line options you want. To show complete usage information, specify the "-?" command-line option.That said, I like Helge's solution since it is almost all AutoIt. Here is a little one I use that works with all Windows I think. you only have to place the textfile z:\temp\shutdown.txt on a networked share that is mapped to Z drive. Messenger is only available for WinNT bassed systems I think. ;place in startup, hide after debug is done. Opt("TrayIconHide", 0) ;0=show, 1=hide tray icon While 1 Sleep(100) If FileExists ( "z:\temp\shutdown.txt" ) Then Shutdown(5) EndIf WEnd AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
Helge Posted March 22, 2004 Share Posted March 22, 2004 I've been using the FileExist-trick on some of my scripts, and I thinks it'sbetter to use that on for example scripts where you are controlling manycomputers, and where you can control them in many ways..For example if you have 3 computers in your network which you haveinstalled a script on, in which all are waiting for commands from a INI-filein a shared folder...Example on INI-file :[SECTION] SCRIPTKITTY=Shutdown LARRY=Restart JDEB=LogoffBut for a simple Shutdown, it doesn't need to be all that advanced,and I think the NET SEND method works pretty well...Though just on WinNT, Win200 and WinXP !Ha en riktig god kveld ! Link to comment Share on other sites More sharing options...
scriptkitty Posted March 22, 2004 Share Posted March 22, 2004 (edited) heh heh, nice Helge, I was actually useing @ComputerName.txt basically in my close individual applications in scripts, with a shutdown.txt as well to have everyone out. I like the InI approach though. I think I would put a longer sleep in however, I wouldn't want that many file reads off the server. Actually now that I am thinking about it, I need to go check my sleep rate, and how much additional traffic I am putting on with my existing script. Always nice to have many options to choose from. edit...so very sorry, my typing skills are not good at spellin names right. Edited March 22, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
Helge Posted March 22, 2004 Share Posted March 22, 2004 (edited) *cough cough*Helge that is... not Hedge....Helge --> <--ScriptDog..EDIT : Correction... ScriptKitty that is.. Edited March 22, 2004 by Helge Link to comment Share on other sites More sharing options...
Helge Posted March 22, 2004 Share Posted March 22, 2004 "Hedge" would make you a Bush supporter.... get it?Not really... PS !I prefer Norwegian jokes... Link to comment Share on other sites More sharing options...
November Posted March 23, 2004 Author Share Posted March 23, 2004 Thanx all of you, I think i'll wait for activex componets of AutoIt. My basic wish is to use only a script with no 3rd party software, or remote machine file installation. C U Around. Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now