Could you help me create a new batch file?

December 15, 2010 at 07:03:04
Specs: Windows 7, na
Hi, i'm currently working on a batch file that automates a process of software installation, and part of this setup process involves the copying of data from an usb attached drive to a new system.

I understand some of the smaller components of this script like:

mountvol | find ":\"

but I don't know how to take that information and turn it into a selectable choice.

What I am after is a file that can provide me with a list of drive letters (including the drive that has the old drive in a caddy connected via usb) and then once it has shown me the drive letters, I can enter the drive letter i want to copy files from, strip the security from it so there won't be access errors etc and then plant it firmly in a folder on the new desktop.

I'm sorry to ask, i've been hunting for help on this for two days and I can't find anything!!

Many many thanks for your time and attention


See More: Could you help me create a new batch file?

Report •

#1
December 15, 2010 at 11:52:14
I have read your post 3 times....
It is up to you of course how you go about loading the computer .....but wouldn't it be easier to put the files or programs you want to load on a cd and then run the batch file from the cd.....or even a flash drive?

Perhaps cloning the old drive to the new one is even a better answer, then doing a repair install.

However I have pasted a bat that might get you started....and then maybe not.

Below is an app loader. It is long in the tooth.....but it works and is easily
modified. You will also see in tools a program called winfile...google for it. It will work in xp and let you search your drives and copy files.

Copy and paste below and save with a .bat extension

@echo off
echo.
echo.
:menue
color 1f
echo *******************************************************
echo * *
echo * --------------------------------- *
echo * *
echo * Windows Application Loader *
echo * *
echo * Work in proggres *
echo * *
echo * *
echo * *
echo *******************************************************
echo.
echo.
echo To Start XP Application Loader press A
echo.
echo To Start 2k Application Loader press B
echo.
echo To run but not install tools press C
echo.
echo To just exit this program press X
echo.
echo.
SET Choice=
SET /P Choice= TYPE THE LETTER AND PRESS ENTER: -^>
IF NOT '%Choice%'=='' SET Choice=%Choice%
:: /I makes the IF comparison case-insensitive
IF /I '%Choice%'=='a' GOTO :go2
IF /I '%Choice%'=='b' GOTO :go
IF /I '%Choice%'=='c' GOTO :tools
IF /I '%Choice%'=='x' GOTO :exit
echo "%Choice%" IS NOT VALID. PLEASE TRY AGAIN
echo.
:tools
cls
color 2f

echo TOOLS
echo ***************************************************************************
echo.
echo Start Everest press A.
echo.
echo Start SIW press B.
echo.
echo Start winfile press C.
echo.
echo Go back to main menu D.
echo.
echo To test sound card E.
echo.
echo Go to Driveragent F.
echo.
echo Majic Jelly Bean G.
echo.
echo Jelly Bean Change key H.
echo.
echo Install sp3 I.
echo.
echo MS Key changer J.
echo.
echo Backup drivers k.
echo.
echo To exit program X.
SET Choice=
SET /P Choice= TYPE THE LETTER AND PRESS ENTER: -^>

IF NOT '%Choice%'=='' SET Choice=%Choice%
:: /I makes the IF comparison case-insensitive
IF /I '%Choice%'=='a' GOTO :everest
IF /I '%Choice%'=='b' GOTO :siw
IF /I '%Choice%'=='c' GOTO :manage
IF /I '%Choice%'=='d' GOTO :menu
IF /I '%Choice%'=='e' GOTO :sound
IF /I '%Choice%'=='f' GOTO :agent
IF /I '%Choice%'=='g' GOTO :bean
IF /I '%Choice%'=='h' GOTO :key
IF /I '%Choice%'=='i' GOTO :sp3
IF /I '%Choice%'=='j' GOTO :mskeys
IF /I '%Choice%'=='k' GOTO :drivers

IF /I '%Choice%'=='x' GOTO :exit
:everest
everest.exe
cls
goto :tools

:siw
siw.exe
cls
goto :tools

:manage
winfile.exe
cls
goto :tools

:menu
cls
goto :menue

:sound

plany work.wav
start d:\media\07-wind.mp3
cls
goto :tools

:agent
start notepad pwd.txt
start firefox.exe http://driveragent.com/
cls
goto :tools

:bean
start key\keyfinder.exe
cls
goto :tools

:key
echo starting Magic Jellybean
start keychange\keyfinder.exe
cls
goto :tools


:sp3
echo Installing sp3
start sp3\sp3.exe
cls
goto :tools

:mskeys
start mskey.exe
cls

:drivers
cd driver
driv.bat
cd..
cls
goto tools


goto :tools

:go
echo Windows 2000 media player is now loading
start /wait loadset\mpsetup.exe /qn /norestart
echo.


goto :go3

:go2
:: echo Windows xp media player is now loading.
:: start /wait loadset\wmp11-windowsxp-x86-enu.exe /qn /norestart
goto :go3

:go3
echo 7 ZIP IS NOW LOADING
echo.
start /wait loadset\7z465.exe /S
echo.
echo FOXIT READER IS NOW LOADING
echo.
start /wait loadset\FoxitReader23.msi /qn
echo.
echo FIREFOX IS NOW LOADING
echo.
start /wait loadset\Firefox3.exe /S
echo.
echo E-SWORD IS NOW LOADING
echo.
start /wait loadset\E-Sword_setup.exe /S /v/qn
echo.
echo.
echo OPEN OFFICE IS NOW LOADING
echo.
echo Please be patient, this takes a little while...
echo.
start /wait loadset\OpenOffice\openofficeorg24.msi /qn /norestart
echo.
echo AVG VIRUS PROTECTION IS NOW LOADING
echo.
start /wait loadset\avg.exe /HIDE
echo.
echo Spybot is now loading
start /wait loadset\spybot.exe /HIDE
echo.
echo ****************************************************


:loop
cls
echo.
echo.
echo Does the computer have a Burner?
SET Choice=
SET /P Choice= TYPE THE LETTER AND PRESS ENTER: -^>
IF NOT '%Choice%'=='' SET Choice=%Choice%
:: /I makes the IF comparison case-insensitive
IF /I '%Choice%'=='y' GOTO :burner
IF /I '%Choice%'=='n' GOTO :dvd
echo "%Choice%" IS NOT VALID. PLEASE TRY AGAIN
echo.
goto :loop

:burner
echo Loading DeepBurner...
start /wait loadset\deepBurner1.exe /S
:dvd
echo.
echo.
echo Does the computer have a DVD player?
echo.
SET Choice=
SET /P Choice= TYPE THE LETTER AND PRESS ENTER: -^>
IF NOT '%Choice%'=='' SET Choice=%Choice%
:: /I makes the IF comparison case-insensitive
IF /I '%Choice%'=='y' GOTO :player
IF /I '%Choice%'=='n' GOTO :continue
echo "%Choice%" IS NOT VALID. PLEASE TRY AGAIN
echo.
GOTO :dvd

:player
echo Loading DVDplayer...
start /wait loadset\DVDplayer.exe /S


:continue
echo.
echo NOW LOADING E-SWORD ADDONS
echo.
@echo off
start /wait C:\progra~1\7-zip\7z.exe e loadset\e-Sword.7z -oC:\progra~1\e-sword
echo.
echo.
echo ZGAMES IS NOW LOADING - takes a while - you're almost there!
echo.
echo computer will restart when finished
echo.
echo ***When computer restarts-Install updates for AVG ***

start /wait C:\progra~1\7-zip\7z.exe x loadset\Zgames.7z -oC:\ -r -y


shutdown /l /r /y
:exit
cls


Report •

#2
December 15, 2010 at 14:25:05
Apologies, my post may not have been ultimately clear.

I have a usb drive which I insert into a newly set up computer. The usb drive already holds all the programs I want to run and I have created some choice based questions using CHOICE and GOTO to essentially create my menu. This loads or installs the programs based on user input.

It's specifically the data transfer stuff i'm looking into as it's the last part that has been irritating the heck out of me.

I'm only wanting to produce a list of drive letters which becomes a choice based menu. Again with user input, the user types in the drive letter of the drive to copy data from and the automated process begins removing the security from the old drive and copying user profiles etc to a desktop icon on the new system.

Again, many thanks for your assistance on this, I do however like the way your menu works :-)

insomnai


Report •
Related Solutions


Ask Question