Force Logoff, XP

Status
Not open for further replies.

G-Sun

Baseband Member
Messages
44
Location
Norway
Hi! :rolleyes:
I'm very new to programming and bat-files..
I'm trying to compile a bat-script for xp pro

The first thing I want it to do is to force logoff of another user.
I've come across the line
shutdown -l
But this will log me off, want it?
How do I specify which user to logoff?

The next steps for my script is closing network and exit my avg-antivirus.
The goal for the script is to make most system-recourses available in one click..

Thanks! :)
 
I am a little bit confused. Are you trying to write logon scripts for a server environment or a batch file from your desktop? Are you trying to run this batch file remotely? The command you gave will logoff the current user.
 
As far as I know you cannot logoff specific users using the command line. Since in effect you cannot specify a machine (-m) you will be unable to logoff users.
Why do we need to do this in batch?

Disconnection from the network can be done by ipconfig /release

Cheers.
 
I am a little bit confused. Are you trying to write logon scripts for a server environment or a batch file from your desktop? Are you trying to run this batch file remotely? The command you gave will logoff the current user.
It's a batch-file for my desktop.
 
That command will log off the current user of the os if run from the desktop so you would not need to specify which user you wish to logoff. write the batch file in notepad and put a shortcut on the desktop and you are good to go.
 
As far as I know you cannot logoff specific users using the command line. Since in effect you cannot specify a machine (-m) you will be unable to logoff users.
Why do we need to do this in batch?

Disconnection from the network can be done by ipconfig /release

Cheers.
Thanks both! Ok, so I can't specify which user to logoff.
But, I see I can do it in the Task Manager.. So it must be possible in some way?

Thanks for the ipconfig-line!

As I said, I would like to make most systems-resources available in one click from my desktop. I'm doing audio-recordings on a multi-user-multi-purpose Pc..

Thanks again for all help :)
 
In task manager you only have the option to logoff the current user not other users on the computer. At least on xp. As for system resources they become available when you logon. Unless I am not understanding you. I do not see why you would need a batch file to make them available.
 
Sorry, maybe my words are not accurate for you. I need all the CPU/Ram that I can get when recording, and I need as few as possible programs jumping in -trying to do something.
Task Manager: I can logoff another user there (positive). I guess it just takes admin-privileges.

It seems like I can use logoff.exe
Article WinItPro
But getting the session-ID is worse. It will change I guess, from time to time.
So it's: logoff.exe /n /f
And how do I specify the user? (In the article it says it can be specified)
 
Task Manager: I can logoff another user there (positive). I guess it just takes admin-privileges.
Sorry I was looking in the wrong spot you are correct. logoff.exe apparently is not used to much because there is not much info about it and I could not find a change user switch. It works pretty good out of task manager and most sites I saw said to do it that way.
 
Status
Not open for further replies.
Back
Top Bottom