Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

Tell a batch file what letter the CD-ROM drive is?

I'm trying to setup a batch file to run multiple programs from a CD.  This CD is being used for Spyware removal when the CD is inserted into the computer.  Currently, the batch file only works with the "D" drive but I would like to have this figure out what the drive letter designation for the CD-ROM drive that I have inserted the disk into and then pass that along to the batch file and run all of the programs in succession.  This is a collaboration between myself and another gent ( I wanted to give credit where credit is due ) and this is the only roadblock that we have run into right now.

The code of the batch file is:

d:
start /wait lspfix.exe
start /wait aaw6181.exe
copy reflist.ref C:\Progra~1\Lavasoft\Ad-awa~1
start /wait spybotsd13.exe /silent /nocancel /components="main"
mkdir C:\Progra~1\Utilit~1\
copy CWShredder.exe C:\Progra~1\Utilit~1\
copy HijackThis.exe C:\Progra~1\Utilit~1\
copy hsremove.exe C:\Progra~1\Utilit~1\
copy Kill2Me.exe C:\Progra~1\Utilit~1\
mkdir "%ALLUSERSPROFILE%\Start Menu\Programs\Utilities"
shortcut /f:"%ALLUSERSPROFILE%\Start Menu\Programs\Utilities\CWShredder.lnk" /a:c /t:c:\Progra~1\Utilit~1\CWShredder.exe
shortcut /f:"%ALLUSERSPROFILE%\Start Menu\Programs\Utilities\HijackThis.lnk" /a:c /t:c:\Progra~1\Utilit~1\HijackThis.exe
shortcut /f:"%ALLUSERSPROFILE%\Start Menu\Programs\Utilities\hsremove.lnk" /a:c /t:c:\Progra~1\Utilit~1\hsremove.exe
shortcut /f:"%ALLUSERSPROFILE%\Start Menu\Programs\Utilities\Kill2Me.lnk" /a:c /t:c:\Progra~1\Utilit~1\Kill2Me.exe
shortcut /f:"%ALLUSERSPROFILE%\Start Menu\Programs\Utilities\Spybot.lnk" /a:c /t:C:\Progra~1\Spybot~1\spybotsd.exe
shortcut /f:"%ALLUSERSPROFILE%\Start Menu\Programs\Utilities\Ad-aware.lnk" /a:c /t:C:\Progra~1\Lavasoft\Ad-awa~1\Ad-aware.exe
rd /s/q "%ALLUSERSPROFILE%\Start Menu\Programs\Spybot - Search & Destroy"
del /q "%USERPROFILE%\Start Menu\Programs\Ad-aware 6.lnk"
rd /s/q "%USERPROFILE%\Start Menu\Programs\Lavasoft Ad-aware 6"
c:
cd C:\Progra~1\Spybot~1
start /wait spybotsd.exe /autoupdate /autocheck /autofix /autoclose
cd C:\Progra~1\Utilit~1\
start /wait CWShredder.exe
start /wait hsremove.exe
start /wait Kill2Me.exe
start /wait HijackThis.exe
cd C:\Progra~1\Lavasoft\Ad-awa~1
start /wait Ad-aware.exe

As you can see, we are using a host of files on the CD to clean up a computer quite quickly and without much user intervention other than clicking "next, next, next, finish" and so on.  

Is there a way to add this functionality to this or would it have to be written as a vbscript of wscript file to be able to do this?

Thanks,

Mike Stevens

P.S.  I'm new to the points thing so please bear with me.  

0
mstevens23
Asked:
mstevens23
3 Solutions
 
sirbountyCommented:
Perhaps something here will help you:
http:Q_10175070.html
http:Q_10083817.html
http:Q_10480178.html
0
 
Julian HansenCommented:
Is there a reason you have to specify a drive at all? What I mean is if you run the batch file from the CD drive it should all be relative to that drive.

Alternatively you could always pass it in as a parameter

go.bat E:

--- GO.BAT
%1
REM rest of bat file
-- END GO.BAT

0
 
RanjeetRainCommented:
Nothing much is required. You just need to remove that first line from your batch file and you will be pretty much okay.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
itcnbwiseCommented:
julianH has it right - pass it as a parameter, since you say there's another program which can pass the drive letter.
0
 
mstevens23Author Commented:
Thanks for all the help with this question.  The first answer is mainly the one that answered my question and pointed me in the direction I needed to be.  

As I stated before I'm new to the "points thing" so if I missed anyone, please accept my apologies.  

Thanks very much for all of your help.

Mike Stevens
0
 
Julian HansenCommented:
but ... but ... but ... <sigh> oh well ...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now