PC Review


Reply
Thread Tools Rating: Thread Rating: 2 votes, 1.00 average.

Command line logoff, not reboot

 
 
Michael Lueck
Guest
Posts: n/a
 
      8th Jul 2004
Is there a command line tool that could be used in a batch script to log the user off the desktop back to Ctrl-Alt-Del login screen?

TIA!

--
Michael Lueck
Lueck Data Systems

Remove the upper case letters NOSPAM to contact me directly.
 
Reply With Quote
 
 
 
 
Olaf Engelke [MVP]
Guest
Posts: n/a
 
      8th Jul 2004
Hi Michael,
Michael Lueck wrote:
> Is there a command line tool that could be used in a batch script to
> log the user off the desktop back to Ctrl-Alt-Del login screen?


what do you think the meaning of logoff.exe is?
Should be located in system32 folder.
Best greetings from Germany
Olaf
 
Reply With Quote
 
Michael Bednarek
Guest
Posts: n/a
 
      8th Jul 2004
On Wed, 07 Jul 2004 21:49:33 -0400, Michael Lueck
<(E-Mail Removed)> wrote in
microsoft.public.win2000.cmdprompt.admin:

>Is there a command line tool that could be used in a batch script to log the user off the desktop back to Ctrl-Alt-Del login screen?


SHUTDOWN.EXE from the Resource Kit, or any number of free utils,
including PsShutdown (see:
<http://www.sysinternals.com/ntw2k/freeware/psshutdown.shtml>)

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
 
Reply With Quote
 
Matthias Tacke
Guest
Posts: n/a
 
      8th Jul 2004
"Olaf Engelke [MVP]" wrote:

>Hi Michael,
>Michael Lueck wrote:
>> Is there a command line tool that could be used in a batch script to
>> log the user off the desktop back to Ctrl-Alt-Del login screen?

>
>what do you think the meaning of logoff.exe is?
>Should be located in system32 folder.
>Best greetings from Germany
>Olaf


Hallo Olaf,
what makes you that shure, he is using windows xp or newer ?
w2k and I think also nt have no logoff.exe

--
Greetings
Matthias________________________________________
For help on nt commands enter in a cmd window:
W2K>HH windows.chm::ntcmds.htm XP>HH ntcmds.chm
 
Reply With Quote
 
Olaf Engelke [MVP]
Guest
Posts: n/a
 
      8th Jul 2004
Hi Matthias,
Matthias Tacke wrote:
> "Olaf Engelke [MVP]" wrote:
>
>> Hi Michael,
>> Michael Lueck wrote:
>>> Is there a command line tool that could be used in a batch script to
>>> log the user off the desktop back to Ctrl-Alt-Del login screen?

>>
>> what do you think the meaning of logoff.exe is?
>> Should be located in system32 folder.

> what makes you that shure, he is using windows xp or newer ?
> w2k and I think also nt have no logoff.exe


you may be right. At least I had it on my Windows 2000 Server (don't have a
workstation run here).
If he doesn't have the NT Server Resource kit somewhere, Michael can get it
also from here:
http://www.microsoft.com/ntserver/nt...it/default.asp
since the tool is included in that package.
Best greetings from Germany
Olaf.

 
Reply With Quote
 
Michael Lueck
Guest
Posts: n/a
 
      8th Jul 2004
Matthias Tacke wrote:

> Hallo Olaf,
> what makes you that shure, he is using windows xp or newer ?
> w2k and I think also nt have no logoff.exe


Ja, das is correct... this is a win2000 group after all! ;-) I know, M$ trying to make everyone believe there is no need for a command promp did not make such a group as thus under the WinXP groups.

I'll check the Win2K RK CD I have, or the online thing.

I had tried the PSShutdown which I use for reboots, it had a -o which said something about logging off the desktop, but alas it rebooted the box.

--
Michael Lueck
Lueck Data Systems

Remove the upper case letters NOSPAM to contact me directly.
 
Reply With Quote
 
Guest
Posts: n/a
 
      9th Jul 2004
In notepad type this.

CONST LOGOFF = 0
CONST SHUTDOWN = 1
CONST REBOOT = 2
CONST FORCE = 4
CONST POWEROFF = 8
For each objpc in getobject("winmgmts:
{(shutdown)}").execquerry("select * from
win32_operatingsystem")
objpc.win32shutdown LOGOFF + FORCE
Next

Line containing LOGOFF + FORCE can be changed with
SHUTDOWN + FORCE or REBOOT or REBOOT + FORCE as per your
requirement. Save this notepad file as logoff.vbs
From command prompt run this file to logoff at desired
times.
Let me know if this helps.
-Nimit


>-----Original Message-----
>Is there a command line tool that could be used in a

batch script to log the user off the desktop back to Ctrl-
Alt-Del login screen?
>
>TIA!
>
>--
>Michael Lueck
>Lueck Data Systems
>
>Remove the upper case letters NOSPAM to contact me

directly.
>.
>

 
Reply With Quote
 
Nimit Mehta
Guest
Posts: n/a
 
      9th Jul 2004
Const LOGOFF = 0
Const SHUTDOWN = 1
Const REBOOT = 2
Const FORCE = 4
Const POWEROFF = 8
For Each objPC In GetObject("winmgmts:
{(shutdown)}").ExecQuery("Select * from
Win32_OperatingSystem")
objPC.Win32Shutdown LOGOFF
Next

-Nimit


>-----Original Message-----
>Is there a command line tool that could be used in a

batch script to log the user off the desktop back to Ctrl-
Alt-Del login screen?
>
>TIA!
>
>--
>Michael Lueck
>Lueck Data Systems
>
>Remove the upper case letters NOSPAM to contact me

directly.
>.
>

 
Reply With Quote
 
David Wang [Msft]
Guest
Posts: n/a
 
      21st Jul 2004
And the amusing thing, of course, is that XP/Windows Server 2003 comes with
VASTLY more commandline tools than Windows 2000 ever did... so we're really
not trying to phase out the command prompt -- we're enhancing its usage.

For example, for shutdown:
1. XP/Windows Server 2003 comes with SHUTDOWN.EXE, which would do what you
want.
2. Small script using WMI also does the same for XP/W2K3, and works on W2K
as well
3. NT4 accepts the predecessor to SHUTDOWN.EXE calling ExitWindowEx.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Michael Lueck" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
Matthias Tacke wrote:

> Hallo Olaf,
> what makes you that shure, he is using windows xp or newer ?
> w2k and I think also nt have no logoff.exe


Ja, das is correct... this is a win2000 group after all! ;-) I know, M$
trying to make everyone believe there is no need for a command promp did not
make such a group as thus under the WinXP groups.

I'll check the Win2K RK CD I have, or the online thing.

I had tried the PSShutdown which I use for reboots, it had a -o which said
something about logging off the desktop, but alas it rebooted the box.

--
Michael Lueck
Lueck Data Systems

Remove the upper case letters NOSPAM to contact me directly.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reboot via command line, over network ? Dave Microsoft Windows 2000 Advanced Server 5 5th Nov 2008 12:54 PM
Re: logoff script via command line Klaus Jorgensen Windows XP Setup 0 2nd May 2008 11:30 PM
RE: logoff script via command line Richard Windows XP Setup 0 2nd May 2008 08:34 PM
RE: logoff script via command line Andrew E. Windows XP Setup 0 30th Apr 2008 12:01 AM
Command Line Logoff or Switch Users Tanch Windows XP Embedded 2 18th Aug 2004 10:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:55 PM.