Solved How do I set up and use RunOnce?

Funky Munky

New member
Local time
4:42 AM
Messages
9
Hello all.

When I do a fresh install of Windows XP, Vista, 7, etc. there are certain programs that I install through batch files after the final reboot.

I cannot combine them into one batch file because each program needs to reboot to finish the installation, and you can't continue the batch after a reboot.

Recently, I started reading about the RunOnce feature.

Before I read deeper into it, I was wondering if it could be applied to run my multiple batch files with a reboot in between.

If I read it correctly, I should be able to write the next RunOnce routine into the registry before the batch file reboots.

Or is there a better way to use this feature?

Thanks.
 

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 7 Home Premium 64 Bit
The Windows registry includes the following two keys -

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
 

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 10
Thanks for the quick reply but those are the same 2 lines that I got from the Microsoft one page explanation.

I miss the days of assembler language / dos / gwbasic, when every command was explained in so much detail it made you want to puke.
 

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 7 Home Premium 64 Bit

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
You can download my RunItOnce utility from my page:
Miles Ahead's Windows Downloads

To use it in a batch file just specify the full path to the exe,cmd or bat file on the command line. See the included Readme.txt file for particulars.

Edit: Note that RunItOnce launched programs actually run before the login prompt, so they should not pop up any dialog boxes or whatnot. Just do tasks like delete files before they are in use by the system etc..
 

My Computer My Computer

Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
You can download my RunItOnce utility from my page:
Miles Ahead's Windows Downloads

To use it in a batch file just specify the full path to the exe,cmd or bat file on the command line. See the included Readme.txt file for particulars.

Edit: Note that RunItOnce launched programs actually run before the login prompt, so they should not pop up any dialog boxes or whatnot. Just do tasks like delete files before they are in use by the system etc..


thanks also, but i wanted something that I could just add to my batch file.
 

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 7 Home Premium 64 Bit
thanks to all for your helpful replies.

I posted this question in numerous forums and finally got it to work.

I just added this line to my batch file before the reboot line

reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v Install /t REG_SZ /d "C:\installing\2.bat"

cheers.

:)
 

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 7 Home Premium 64 Bit
Back
Top