PDA

View Full Version : Log off and log on without a reboot? (W2K)



guyver_news
02-22-2003, 09:02 AM
Dear all,

Is there a way to log off and log back on as a particular user without a reboot?

Setting the registry to "1" below allows me to log on as the user, but i require a reboot:
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon

Is there another way to do this? My script sets the registry and then reboots to allow a set user to log on and then does an install of a program and resets the registry and reboots again.

If I can simply log off and log on as a user, this will save the reboots.

Any ideas?

Thanks

Andy

Blyxnis
03-06-2003, 01:31 PM
I am not shure, this is the right answer, but You can try to end task of "explorer", and then create new task "explorer".
Usualy this helps to take effect of registry settings, without rebooting.

guyver_news
03-18-2003, 03:28 AM
Thanks,

But it would mean user intervention which I want to avoid and allow the script to be unattended.

Any further thoughts?

Andy

jdharm
03-18-2003, 10:19 AM
If the application that got installed doesn't require a reboot, why not just have the script log out the admin user after reseting the AutoLogin instead of doing a full reboot. Insert the Jama script:


Set objSystemSet = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown )}")_
.InstancesOf("Win32_OperatingSystem")

For Each objSystem In objSystemSet
objSystem.Win32Shutdown <font color=blue>__</font color=blue>
Next


Fill in the <font color=blue>__</font color=blue> with a number listed
0- Logoff
1- Shutdown
4- Force Logoff
2- Reboot
6- Force Reboot
8- Powerdown
12- Force Powerdown






Josh

The proceeding was from the "For What It's Worth" files, which by definition may be worthless. Take with a grain or ten of salt.

cprasley
04-18-2003, 02:23 PM
To set the auto-logon usename and password, insert/update the registry keys HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\WinLogon\
AutoLogon = usename
autologonpassword = password

Then all you have to do is force a logout somehow.