Jump to content

Set a different drive for apps directory in RunOncEx


Recommended Posts

I want my RunOnceEx to check for the existence of application directory on my F Drive and to assign it to PP rather than to use the app dircectory on C drive.

What I want is something like:

cmdow @ /HID

@Echo Off

IF EXIST F:\WINXPHOME\$OEM$\$1\Install\Apps\RunOncEx2.cmd

SET PP=F:\WINXPHOME\$OEM$\$1\Install\Apps\

ELSE

SET PP=SET PP=%SystemDrive%\Install\Apps\

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

It does not work. Can someone help with the language part?

Link to comment
Share on other sites


Try this

@Echo Off
CLS
Color 17
Title Run Once Ex

IF EXIST F:\WINXPHOME\$OEM$\$1\Install\Apps\RunOncEx2.cmd Goto Install1

IF Not EXIST F:\WINXPHOME\$OEM$\$1\Install\Apps\RunOncEx2.cmd Goto Install2

:Install1
SET PP=F:\WINXPHOME\$OEM$\$1\Install\Apps\
Goto R1

:Install2
SET PP=%SystemDrive%\Install\Apps\
Goto R1

:R1
SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx.

Link to comment
Share on other sites

From the code you've provided I'd say you should try this:

@Cmdow @ /HID || @Echo Off
Setlocal
(Set AP=F:\WINXPHOME\$OEM$\$1) & (Set AD=\Install\Apps\)
(Set KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx)
If Exist %AP%%AD%RunOncEx2.cmd (Set PP=%AP%%AD%) Else (Set PP=%SystemDrive%%AD%)

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