Jump to content

prepare.cmd and cleanup.cmd?


 Share

Recommended Posts

Sorry if i bothering you with my stupid question!

The RunOnceEx file contain 2 command lines launching prepeare.cmd and cleanup.cmd files as shonwn in the example here bellow

cmdow @ /HID
@echo off

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

REG ADD %KEY% /V TITLE /D "Installing Applications" /f

REG ADD %KEY%\001 /VE /D "Preparing Installation..." /f
REG ADD %KEY%\001 /V 1 /D "%systemdrive%\install\prepare.cmd" /f

REG ADD %KEY%\005 /VE /D "Adobe Reader 6" /f
REG ADD %KEY%\005 /V 1 /D "%systemdrive%\install\AdobeReader6\AR6.msi /qn" /f

REG ADD %KEY%\055 /VE /D "Cleaning Up and Rebooting" /f
REG ADD %KEY%\055 /V 1 /D "%systemdrive%\install\cleanup.cmd" /f

EXIT

How far I know/learn,

prepare.cmd file is used for things i want the runonceex.cmd to do before it got rolling and

cleanup.cmd for what i want it to do at the end (like deleting stuff, etc).

I could find example of files in the Unattended Guide except for prepare.cmd.

1) My RunOnceEX contain the batch for Office2003, MUI 2003, Diskeeper, Acrobat PowerDVD6, NAV Corp9...

How do i intend that ineed a prepare.cmd???

Does someone else can give me a link for a prepare.cmd example???

2) On the cleanup.cmd file exapmle, there are few "del" command regarding Adobe 6, are there any for Acrobat 7(not reader)???

How do i know that this apps need a "RD" and/or "del" command???

TNX for yr help

coucou

Link to comment
Share on other sites


I couldn't really understand all what you were actually asking..

So if I understood you correctly... You only need "a prepare.cmd" if there is something you want to run before the programs install in RunOnceEx.. So it's up to you. If you cant think of anything you need to add in it you wont probably need it. (OR if you want to write the install commands into the prepare.cmd and make RunOnceEx run it... well, then that's your choice but it defeats most of the point of using RunOnceEx at all)

The DEL command is used to delete a file or a group of files (wildcard, for example *.jpg)

The RD command (Remove Directory) is as the name says used to delete directories.

So if you want to delete a file or files use DEL.. if you want to remove the entire directory (and all the files in it) use RD.

2) On the cleanup.cmd file exapmle, there are few "del" command regarding Adobe 6, are there any for Acrobat 7(not reader)???

Do you mean things like deleting shortcuts? Just find the location and name of the shortcut and write the command yourself... DEL /Q "%systemdrive%\shortcut_location\shortcut.LNK"

Link to comment
Share on other sites

TNX for yr help and excuse my poor english. I try to make myself more clear.

prepare.cmd

As I'm not a computer expert, i would like to know what kind of "prepare" i do need, because every one here in our forum have that file.

In fact, all RunOnceEx.cmd examples are starting with a line like REG ADD %KEY... ...\prepare .cmd" /f and i didn't saw any prepare.cmd exapmle, I tought there is a "standard" prepare.cmd file.

May someone let me look his own prepare.cmd???

cleanup.cmd

How do i know that special apps need a "rd" or "del" link???

I notice that some apps like Acrobat 7, Roxio easy Media creator 7... are running a remove backup routine at the end of them standard installation. Do they need therefore a rd/del command line in the cleanup.cmd file??? If so, how could i know what link and where is it???

Regards

coucou

Link to comment
Share on other sites

1:\ A prepare cmd is a option I dont use one

2:\ The RunOnceEx.cmd Is What You Use To Install Stuff

3:\ The Clean Up Cmd Is To Remove The Install And Drivers

Folders

Example Of A RunOnceEx.cmd

REG ADD %KEY%\065 /VE /D "Ua065 %A1% Wrar341" /f
REG ADD %KEY%\065 /V 1 /D "%CD1%Ua065\Wrar341-SFX.exe" /f

Here A Clean Up Cmd That Will Remove The Install And Driver Folders Remove These Shortcuts.

CMD

echo off

cls

color f1

mode con: Cols=53 Lines=5

Title Clean R1

IF EXIST net user aspnet /delete

IF EXIST %SYSTEMDRIVE%\CleanR1.vbs GOTO WORK

if not exist %SYSTEMDRIVE%\CleanR1.vbs goto OPS

ping -n 2 127.0.0.1>Nul | Echo Processing.......

:WORK

START %SYSTEMDRIVE%\CleanR1.vbs

echo.

ping -n 3 127.0.0.1>Nul | Echo Running CleanUp Script!!.......

echo.

exit

:OPS

echo.

ECHO  R1Cleanup.vbs Is Not At This Location:

ECHO  Missing    %systemdrive%\R1Cleanup.vbs

ping -n 7 127.0.0.1>nul | Echo  Cleanup Of Ua Files Cancel!!!!!

echo.

exit

Things In Purple Are Varibles I Have Try To Add As Many Generic Spots To That People Seem To Use In The Ua. If There Are Some That I Missed Please Post Some More So I Can Add Them To The Script.

The Stuff That Is Orange Is Inactive This Is Safe To Delete Or You Can Edit Them To Match Your Needs. '''''' These Must Be Removed

The Front Of The Script, To Make Active.

The Stuff InGreen Is Safe To Remove From The Script Or Edit To Suit Your Needs

The Stuff That Is Red Use Caution When Editing

VBS SCRIPT

On Error Resume Next

Dim Garbage, Shell, AP, UP, SD, SP

Set Shell = WScript.CreateObject("WScript.Shell")

A1 = Shell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%\")

A2 = Shell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%\DESKTOP\")

A3 = Shell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%\START MENU\")

A4 = Shell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%\START MENU\PROGRAMS\")

B1 = Shell.ExpandEnvironmentStrings("%USERPROFILE%\")

B2 = Shell.ExpandEnvironmentStrings("%USERPROFILE%\DESKTOP\")

B3 = Shell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%\START MENU\")

B4 = Shell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%\START MENU\PROGRAMS\")

SD = Shell.ExpandEnvironmentStrings("%SYSTEMDRIVE%\")

SP = Shell.ExpandEnvironmentStrings("%SYSTEMDRIVE%\Program Files\")

W1 = Shell.ExpandEnvironmentStrings("%WINDIR%\")

W2 = Shell.ExpandEnvironmentStrings("%WINDIR%\RESOURCES\THEMES\")

W3 = Shell.ExpandEnvironmentStrings("%WINDIR%\SYSTEM32\")

W4 = Shell.ExpandEnvironmentStrings("%WINDIR%\WEB\WALLPAPER\")

Set fso = CreateObject("Scripting.FileSystemObject")

''''''''' REMOVE THESE '''''' BEFORE ANY THING TO MAKE ACTIVE

''''''''' SHORTCUT EXAMPLES

'fso.DeleteFile( A2 & "BSPlayer.lnk")

'fso.DeleteFile( A2 & "Media Player Classic.lnk")

'fso.DeleteFile( A2 & "HP Director.lnk")

'fso.DeleteFile( A2 & "HP Memories Disc.lnk")

'fso.DeleteFile( A2 & "HP Photo & Imaging.lnk")

'fso.DeleteFile( A3 & "Set Program Access and Defaults.lnk")

'fso.DeleteFile( A3 & "Windows Catalog.lnk")

'fso.DeleteFile( A3 & "Java Web Start.lnk")

''''''''' -------- FOLDERS -----------> fso.DeleteFolder( SD & "SOMEFOLDER")

''''''''' EXAMPLE  THIS IS WHAT THE COMPUTER READS %SYSTEMDRIVE%\SOMEFOLDER

fso.DeleteFolder( SD & "DRIVERS")

fso.DeleteFolder( SD & "INSTALL")

''''''''' USE THIS TO DELETE ANY EXTRA FILES

''''''''' I USE THIS TO DELETE THIS FILE AND THE CMD THAT CALLS IT

fso.DeleteFile( A2 & "Java Web Start.lnk")

fso.DeleteFile( A2 & "Nero StartSmart.lnk")

fso.DeleteFile( A2 & "Mozilla.lnk")

fso.DeleteFile( A3 & "Set Program Access and Defaults.lnk")

fso.DeleteFile( A3 & "Windows Catalog.lnk")

fso.DeleteFile( SD & "CLEANR1.VBS")

fso.DeleteFile( SD & "CLEANR1.CMD")

''''''''' FILES

MSGBOX "Defualt Install And Drivers Deleted" & vbcrlf & "Defualt ShortCuts Deleted" & vbcrlf & "Deleted Files For Script", 0 + 64,"RUNONCE CLEAN UP!"

To Test This Script

Make 2 Folders On Systemdrive

Systemdrive Is Where You Have Windows Installed

Install

Drivers

Than Run The Sfx File And The 2 Folders Will Be Gone

Plus Any Shortcuts That Are Listed.

Edited by gunsmokingman
Link to comment
Share on other sites

Many TNX gunsmokingman

BTW, an hour ago and ffter a looooong search I could find Clean up Cmd Template... Do you know it??? it's YOURS :D

As i'm not a coder, may you difference between the file here attached and the file in "Clean up Cmd Template" attached. In other hand, what file for best use.

Again TNX

coucou

Link to comment
Share on other sites

Oh OK!!!

To summarize, i may remove my cleanup.cmd file in my x:\XPCD\Software and replace it by CLEANR1.exe this thread attached???

and here will be the command line in RunOnceEx???

REG ADD %KEY%\100 /VE /D "Cleaning Up and Rebooting" /f
REG ADD %KEY%\100 /V 1 /D "%CDROM%\Software\CLEANR1.exe" /f

If so, what about this command line for PowerDVD6 in my actual clenup.cmd

del "%systemdrive%\Program Files\CyberLink\PowerDVD\OLRSubmission\OLRSubmission.exe"
del "%systemdrive%\Documents and Settings\All Users\Start Menu\Programs\CyberLink PowerDVD\On-Line Registration.lnk"

Regards

coucou

Link to comment
Share on other sites

  • 5 weeks later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...