Jump to content

Recommended Posts

Posted

i tried to open a "cmd" file after the reboot but the RunOnce didnt work.

i placed in registry:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce]
@="%systemdrive%\\install\\file.cmd"

after the rebbot i see that in the registry the line desapeard (with the file that i want) but the cmd is not running.

i tried a simple cmd that makes a folder.

and i tried it.. and it didnt work

how can i repair it


Posted

Try this

echo off

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

REG ADD %KEY% /V TITLE /D "The Install Section"/f

REG ADD %KEY%\001 /VE /D "Test The file.cmd"/f

REG ADD %KEY%\001 /V 1 /D "%systemdrive%\install\file.cmd"/f

Posted

I would use the HKLM key since the HKCU doesn't exist in a default installation, also I would create a named key, not use the default, @, key.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"RunMyCmd"="%systemdrive%\\install\\file.cmd"

The other thing you will have to do is ensure that the folder, install, and file, file.cmd, have not been removed as part of a cleanup routine prior to the reboot.

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...