Jump to content

[SOLVED] RunOnceEX is no longer executed


Recommended Posts

Good morning.
I am struggling with a strange RunOnceEx situation.
I have been using this procedure for years from W7 up to W11 22H2 and it works regularly on both HOST PC and virtual machine, but these days an unexplainable thing happens to me.
When I run this procedure on a newly built pc with Ryzen 9 7950X and still running W11 22H2, the RunOceEx does not run, when I try the same ISO with RunOnceEx on another PC or virtual machine it runs.
I have been going crazy for a few days and can't figure out why and don't know what solution to look for.
Any ideas?
This is the "setupcomplete.cmd" script that I have always uitilized.

Screenshot-003.png

Sincerely thank you

Edited by DMD61
Link to comment
Share on other sites


Thanks for the information.

But I found the cause of the problem and the solution.
Since a few days ago to save the number of usb sticks, I created the bootable usb stick not as I used to do with RUFUS but with Ventoy so that I can insert more ISOs of operating systems and tools.
    And it is just the usb stick created with Ventoy that does not allow me to run RunOnceEx, the usb stick created with Rufus works without problems.
To solve definitavemene the problem with multiboot software like Ventoy in this way:

I found the script solution to make the RunOnceEx procedure work on Ventoy as well.
It involves synthesizing the "Software" folder in the Windows directoty
and then when the Windows installation is finished, when you enter the user name via the registry the programs in the "Software" folder are installed and when it finishes all the installations, the "Software" folder is deleted.

Setupcomplete

@echo off

SET CDROM=%WINDIR%\Setup

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

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

REG ADD %KEY% /V Title /D "Post Installation..." /f  >NUL

REG ADD %KEY%\06 /VE /D "Calcolatrice Legacy" /f  >NUL
REG ADD %KEY%\06 /V 1 /D "%CDROM%\Software\Calcolatrice_Legacy_2.0.exe" /f  >NUL

REG ADD %KEY%\42 /VE /D "Deleting Setup folder" /f  >NUL
REG ADD %KEY%\42 /V 1 /D "%CDROM%\Software\Deleting_Setup_folder.bat" /f  >NUL

EXIT

Deleting_Setup_folder

echo off
cls

rem -----Deleting_Setup_folder--------
rd "%windir%\Setup" /S /Q

exit

Senza-titulo-1.png

Edited by DMD61
Link to comment
Share on other sites

  • DMD61 changed the title to [SOLVED] RunOnceEX is no longer executed

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