Jump to content

RunOnceEx


smeko

Recommended Posts

Hello. Im trying do run the apps from differents map's but i only get error.

I have RunOnceEx in $OEM$ directory and a mapp called apps and everything working. I have all updates and softwares in one mapp i want in differents mapps.

working2vp3.jpg

cmdow @ /HID
@Echo Off

FOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\win51ip.SP2 SET CDROM=%%i:

SET PP=%cdrom%\Apps\

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

REG ADD %KEY% /V TITLE /D "Installerar applikationer" /f

REG ADD %KEY%\001 /VE /D "Windows Verktyget Borttagning av skadlig programvara - Jun. 2007" /f
REG ADD %KEY%\001 /V 1 /D "%PP%KB890830.exe /q" /f

REG ADD %KEY%\002 /VE /D "INTERNET UPPDATERING" /f
REG ADD %KEY%\002 /V 1 /D "%PP%KB890830.exe /q" /f

REG ADD %KEY%\003 /VE /D "CardSpace-uppdateringspaket" /f
REG ADD %KEY%\003 /V 1 /D "%PP%KB925720.exe /q" /f

REG ADD %KEY%\004 /VE /D "XML Core Services 6.0" /f
REG ADD %KEY%\004 /V 1 /D "%PP%KB927977.exe /q" /f

REG ADD %KEY%\005 /VE /D ".NET Framework 1.1" /f
REG ADD %KEY%\005 /V 1 /D "%PP%dotnetfx.exe" /f

REG ADD %KEY%\006 /VE /D ".NET Framework 1.1 Service Pack 1" /f
REG ADD %KEY%\006 /V 1 /D "%PP%KB867460.exe /q" /f

REG ADD %KEY%\007 /VE /D "S„kerhetsuppdatering f”r .NET Framework 2.0 (1)" /f
REG ADD %KEY%\007 /V 1 /D "%PP%KB917283.exe /q" /f

REG ADD %KEY%\008 /VE /D "S„kerhetsuppdatering f”r .NET Framework 2.0 (2)" /f
REG ADD %KEY%\008 /V 1 /D "%PP%KB922770.exe /q" /f

REG ADD %KEY%\009 /VE /D "S„kerhetsuppdatering f”r .NET Framework 1.1" /f
REG ADD %KEY%\009 /V 1 /D "%PP%KB886903.exe /q" /f

REG ADD %KEY%\010 /VE /D "Spr†kpaket f”r .NET Framework 1.1" /f
REG ADD %KEY%\010 /V 1 /D "%PP%langp1.exe" /f

REG ADD %KEY%\011 /VE /D "Microsoft .NET Framework 2.0 SP1" /f
REG ADD %KEY%\011 /V 1 /D "%PP%2.0sp1.exe /q /norestart" /f

REG ADD %KEY%\012 /VE /D ".NET Framework 3.0" /f
REG ADD %KEY%\012 /V 1 /D "%PP%dotnet3.exe /q /norestart" /f

REG ADD %KEY%\013 /VE /D "Microsoft .NET Framework 3.0 SP1" /f
REG ADD %KEY%\013 /V 1 /D "%PP%3.0SP1.exe /q /norestart" /f

REG ADD %KEY%\014 /VE /D "L„gger till \"User Accounts 2\" i kontrollpanelen" /f
REG ADD %KEY%\014 /V 1 /D "%PP%userpasswords2.bat" /f

EXIT

And here is my script that doesnt work. In this script i want to run it from java the exe file. im trying 3 differents methods

errornr5.jpg

cmdow @ /HID
@Echo Off

FOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\win51ip.SP2 SET CDROM=%%i:

SET PP=%cdrom%\Apps\

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

REG ADD %KEY% /V TITLE /D "Installerar applikationer" /f

REG ADD %KEY%\001 /VE /D "Java1" /f
REG ADD %KEY%\001 /V 1 /D "%CDROM%\java\java.exe /q" /f

REG ADD %KEY%\002 /VE /D "Java2" /f
REG ADD %KEY%\002 /V 1 /D "%systemdrive%\java\java.exe /q" /f

REG ADD %KEY%\003 /VE /D "Java3" /f
REG ADD %KEY%\003 /V 1 /D "%PP%\java\java.exe /q" /f

EXIT

i got error all the time

3unitic9.jpg

Link to comment
Share on other sites


You're messing things up. Remove the line "SET PP=%cdrom%\Apps\" from your scripts completely. The line "SET CDROM=%%i:

" creates the variable %CDROM%, so if you have a folder named "Apps" in the root of your CD, the command to install an application would be "%CDROM%\Apps\YourApplication.exe". You could replace the whole line with the "SET CDROM" with the following by the way, which is shorter:

SETLOCAL ENABLEEXTENSIONS
SET CDROM=%~d0

Link to comment
Share on other sites

You're messing things up. Remove the line "SET PP=%cdrom%\Apps\" from your scripts completely. The line "SET CDROM=%%i:

" creates the variable %CDROM%, so if you have a folder named "Apps" in the root of your CD, the command to install an application would be "%CDROM%\Apps\YourApplication.exe". You could replace the whole line with the "SET CDROM" with the following by the way, which is shorter:

SETLOCAL ENABLEEXTENSIONS
SET CDROM=%~d0

Thanks brother for the help its working now i got my full uppdated cd with many extensions. Thanks again brother :)

Peace

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