Jump to content

Log RunOnceEx


Recommended Posts

I was looking for a way to capture in a logfile the activities whenh RunOnceEx executes. I came across the following topic:

http://www.jsiinc.com/subb/tip0500/rh0501.htm

So I used this and it works great, here's an example:

set log=%logdir%\install.log

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V FLAGS /D 0x00000030 /t REG_DWORD /f
REG ADD %KEY% /V TITLE /D "post Install Script" /f

REG ADD %KEY%\020 /VE /D "Adjusting Windows boot-menu" /f
REG ADD %KEY%\020 /V 1 /D "%comspec% /c echo --- Adjusting Windows boot-menu>>%log% 2>&1" /f
REG ADD %KEY%\020 /V 2 /D "bootcfg /timeout 5" /f
REG ADD %KEY%\020 /V 3 /D "bootcfg /delete /ID 2" /f

REG ADD %KEY%\030 /VE /D "Change 'My Computer' " /f
REG ADD %KEY%\030 /V 1 /D "%comspec% /c echo --- Change 'My Computer' >>%log% 2>&1" /f
REG ADD %KEY%\030 /V 2 /D "regedit -s %SystemDrive%\$oem$\MyComp.reg" /f

REG ADD %KEY%\040 /VE /D "Allocate reserve-file of 256 Mb" /f
REG ADD %KEY%\040 /V 1 /D "%comspec% /c echo --- Allocate reserve-file of 256 Mb >>%log% 2>&1" /f
REG ADD %KEY%\040 /V 2 /D "fsutil file createnew c:\reserve.donotdelete 256000000" /f

Link to comment
Share on other sites


I have yet to try this, but you can change the flags
0x00000020

Create Execution Log File

Create a C:\Windows\RunOnceEx.log file with status of commands

REG ADD %KEY% /V FLAGS /D 0x00000020 /t REG_DWORD /f

I've tried to use an equal command to prevent error dialog boxes. It didn't work...

Link to comment
Share on other sites

Me too, as you can see I still had the flags=30 in; never got any result; errors or not.

And if you follow the URL you can capture the whole bachtfile like this in a logfile.

Link to comment
Share on other sites

Perhaps try this I notice instead I have /t which comes first which work's here

REG ADD %KEY% /v Flags /t REG_DWORD /d "30" /f

Heres syntax

REG ADD KeyName [/v ValueName | /ve] [/t Type] [/s Separator] [/d Data] [/f]

Do you get the C:\Windows\RunOnceEx.log log file? I have the /T first in my reg command, and I don't seem to get it either. I am using 0x00000030 though, not the "30" as you have it. Your's should be interpreted as the decimal 30, not the hex as I have it. From the website I grabbed it from, it uses hex.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...