Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Login and Run Program script

Status
Not open for further replies.

Ednetman

Technical User
May 20, 2002
54
0
0
US
I am looking for a way to make a machine login as a predefined user (either local or domain) and execute a program or batch file. I would like for it to lock the machine while the program is running and then reboot after completion. At this point, I would be happy with the logon portion though. Looking for either a program that can be run remotly, a vbscript that can be executed remotly or put into the local scheduler, etc.

Thanks!
 
Ednetman:

Use Scheduled Tasks in Control Panel. Add a task and set the user and the task to run and time it should trigger

Hope this helps

Mickey
 
Not quite. For internet explorer to finish it's instalation, a true CTRL+ALT+DEL login has to be sent. I know this is a tough one, but I know I have seen it be done in the past.
 
I am trying to remte install software that needs an administrative login to complete suche as Internet Explorer 6, Crystal Repots (, etc. I can kick off the install with no problem, but when a user logs in it tells them they administrative rights and then kicks them out.
 
Guess your options are:

1- pcAnywhere
2- GoToMyPC.com

Good luck
 
No, both of these would require me to log in. I have 4,200 machines to update IE on and the whole point is to not touch them, not impact the users production, and to run automatically overnight. I have everything solved with the exception of the required Admin login after reboot.
 
IE updates would be handled late at night using SUS server or the SMS server.



 
SUS runs on a server. Being desktop support we are not allowed to have any servers. SUS is not an available option at this time.
 
4200 machines and no servers is tough.

Look carefully at Scheduled Tasks again. There is on the first page of the Task Properties the ability to change the Run as username and password for the task.

You may need to use within the script itself the RUNAS features if you feel uncomfortable exposing the local administrator username and password in plaintext under Scheduled Tasks, or use the AT feature to schedule remotely a one-time task.

All three facilities: Scheduled Task, AT, and RUNAS allow you to pass alternative credentials so that the task executes under the security principle of the username you specify. For AT style scheduled tasks, open Scheduled Tasks, at the top level menu, Advanced, and enter values for the "AT service account" option to provide the needed credentials.

The PsExec tool I linked earlier also provides a mechanism to pass alternative credentials.

The tool that helps is to use Qchain.exe from Microsoft to package the installation and use the result as the target of a scheduled task running under local administrator credentials and password:
 
Also, this thread about using a .vbs "wrapper" works equally well as a solution in Win2k: thread779-676827

 
I am trying to remte install software that needs an administrative login to complete suche as Internet Explorer 6, Crystal Repots (, etc. I can kick off the install with no problem, but when a user logs in it tells them they need administrative rights and then kicks them out.
 
Go here and search on "Auto Logon"
At some point in your automated install fire off a reg package that updates the required keys. If only one auto logon required fire regs keys from run once that clean up these keys. If more than once work your way through run onces until you're ready to remove i.e. runonce_1 - runonce_2 - etc. At end of clean up of keys call shutdown.exe to restart.
That is if I understand the question.
 
Thanks for everyone's help. The issue was more complicated because of the use of the Novell Client on our site. I found what I needed on this board, and others. Thanks LOB for pointing me to WinGuides, they had the keys for the Novell Client.

This is what finally worked:
I zipped IE6, the MS03-048 patch, a couple of batch files and a vbscript together and then used SFX maker to create a self extracting file that unzipped itself to the the C:\TMP folder. It then fires off the VBScript automatically. This runs a batch that copies a batch file to "All Users Startup", merges the autologin registry key, and runs the IE6 Update. When the machine reboots, it then auto logs in, runs the batch file in the startup, and restores the original reg files. A shutgui at the end of the batch file finishes everything off, and the users is ready to go!

Registry Keys:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows

NT\CurrentVersion\Winlogon]
"AutoAdminLogon"="1"
"ForceAutoLogon"="1"
"DontDisplayLastUsername"="0"
"DefaultDomainName"="My_Domain"
"DefaultUserName"="Domain_User"
"DefaultPassword"="Domain_Password"
"LegalNoticeCaption"=-
"LegalNoticeText"=-
"PowerdownAfterShutdown"="0"
"ShutdownWithoutLogon"="0"
"AutoAdminLogon"="1"
"ShowLogonOptions"=dword:00000001
"AltDefaultUserName"="Domain_User"
"AltDefaultDomainName"="My_Domain"
"CachePrimaryDomain"="My_Domain"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersio

n\policies\system]
"dontdisplaylastusername"=dword:00000001
"legalnoticecaption"=-
"legalnoticetext"=-
"shutdownwithoutlogon"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Login]
"Default WS Only"=dword:00000001
"AutoAdminLogon"="1"
"ForceAutoLogon"="1"
"DontDisplayLastUsername"="0"
"DefaultDomainName"="My_Domain"
"DefaultUserName"="Domain_User"
"DefaultPassword"="Domain_Password"
"DefaultLocationProfile"="Default"

[HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Location

Profiles\Services\{1E6CEEA1-FB73-11CF-BD76-00001B27DA23}\Def

ault]
"Default WS Only"=dword:00000001
"Save On Exit"=dword:00000001
"Tab"="NT Credentials"
"UserName"="Domain_User"
"AutoAdminLogon"="1"
"ForceAutoLogon"="1"
"DontDisplayLastUsername"="0"
"DefaultDomainName"="My_Domain"
"DefaultUserName"="Domain_User"
"DefaultPassword"="Domain_Password"

[HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Location

Profiles\Services\{1E6CEEA1-FB73-11CF-BD76-00001B27DA23}\Def

ault\Tab3]
"Tab"="NT Credentials"
"AutoAdminLogon"="1"
"ForceAutoLogon"="1"
"DontDisplayLastUsername"="0"
"DefaultDomainName"="My_Domain"
"DefaultUserName"="Domain_User"
"DefaultPassword"="Domain_Password"
"Save On Exit"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Novell\NWGINA\Login Screen]
"AutoAdminLogon"="1"
"ForceAutoLogon"="1"
"DontDisplayLastUsername"="0"
"DefaultDomainName"="My_Domain"
"DefaultUserName"="Domain_User"
"DefaultPassword"="Domain_Password"

[HKEY_USERS\.DEFAULT\Control Panel\Keyboard]
"InitialKeyboardIndicators"="2"
"KeyboardDelay"="1"
"KeyboardSpeed"="31"

This would be applied using regedit.exe /s at the begining of the install.

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top