RUNONCE Key Is Processed Immediately When RUNDLL32 Is CalledID: Q173039
|
If you place items in the RUNONCE key so that they will run the next time
you log on, they will run as soon as Rundll32.exe is run, whether or
not logging on is in progress. This is a design feature of Rundll32.exe for
Windows NT 4.0 Server and Workstation.
This feature can cause problems, however, during an unattended installation
of Windows NT version 4.0 using the Cmdlines.txt option. This article
discusses these possible problems and some ways to avoid them.
To produce the desired results from the RUNONCE key, it is very important
not to add any values to it before running Rundll32.exe options. This
includes using a Windows 95-style .inf to add the RUNONCE registry values.
You can re-create and examine the effects of launching Rundll32.exe when
there is a RUNONCE value ready to run by using the following steps:
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
\RunOnce]
"doit"="c:\\test\\test.cmd"
@ECHO OFF
REGEDIT.EXE /s RUNONCE.REG
rundll32 setupapi,InstallHinfSection DefaultInstall 128 .\test.INF
@echo off
ECHO HELLO WORLD
PAUSE
[Version]
Signature = "$Windows NT$"
[DefaultInstall]
AddReg = AddReg
DelReg = DelReg
UpdateInis = UpdateInis
[AddReg]
[DelReg]
[UpdateInis]
[Commands]
"rundll32 setupapi,InstallHinfSection DefaultInstall 128 .\test.INF"
"REGEDIT.EXE /s .\RUNONCE.REG"
http://www.microsoft.com/ntworkstation/info/deployguide.htmNOTE: The deployment guide is valid for both Windows NT Workstation and Windows NT Server.
Keywords : kbsetup ntsetup ntreskit NTSrvWkst
Version : WinNT:4.0 Windows 95
Platform : winnt
Issue type : kbprb
Last Reviewed: February 25, 1999