MSFN Forum: prepare.cmd and cleanup.cmd? - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

prepare.cmd and cleanup.cmd? Rate Topic: -----

#1 User is offline   coucou 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 811
  • Joined: 01-January 04

Posted 18 January 2005 - 01:59 PM

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


#2 User is offline   Gagorian 

  • Junior
  • Pip
  • Group: Members
  • Posts: 76
  • Joined: 21-December 04

Posted 18 January 2005 - 02:47 PM

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.

Quote

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"

#3 User is offline   coucou 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 811
  • Joined: 01-January 04

Posted 19 January 2005 - 08:32 AM

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

#4 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,020
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 19 January 2005 - 12:09 PM

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

Quote

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

Quote

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.

This post has been edited by gunsmokingman: 22 February 2006 - 02:53 AM


#5 User is offline   coucou 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 811
  • Joined: 01-January 04

Posted 19 January 2005 - 02:17 PM

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

#6 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,020
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 19 January 2005 - 04:58 PM

The Ones In Tools You have To edit To make Work.
This One Is What The One In The Template Can Be Made In to.
I would use this one here as it will remove the main folders, and
those shortcuts listed, in the post. Without editing it more.

#7 User is offline   coucou 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 811
  • Joined: 01-January 04

Posted 20 January 2005 - 08:14 AM

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

#8 User is offline   muiz 

  • SPECIAL
  • PipPipPipPipPipPip
  • Group: Banned
  • Posts: 1,055
  • Joined: 03-August 03
  • OS:none specified
  • Country: Country Flag

Posted 20 February 2005 - 07:35 AM

Quote

CLEANR1.exe


??

#9 User is offline   Astalavista 

  • MSFN loyalist
  • PipPipPipPipPipPipPipPipPip
  • Group: Banned
  • Posts: 3,338
  • Joined: 02-December 03

Posted 20 February 2005 - 07:48 AM

I only use prepare to delete my dp or drivers folder.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy