Solved

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

Posted on 2004-09-13
6
245 Views
Last Modified: 2009-12-16
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
Comment
Question by:mstevens23
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 67

Assisted Solution

by:sirbounty
sirbounty earned 150 total points
ID: 12043289
Perhaps something here will help you:
http:Q_10175070.html
http:Q_10083817.html
http:Q_10480178.html
0
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 12043972
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
 
LVL 19

Assisted Solution

by:RanjeetRain
RanjeetRain earned 50 total points
ID: 12044744
Nothing much is required. You just need to remove that first line from your batch file and you will be pretty much okay.
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 4

Accepted Solution

by:
itcnbwise earned 50 total points
ID: 12044880
julianH has it right - pass it as a parameter, since you say there's another program which can pass the drive letter.
0
 

Author Comment

by:mstevens23
ID: 12181075
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
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 12181208
but ... but ... but ... <sigh> oh well ...
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
A short article about problems I had with the new location API and permissions in Marshmallow
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Introduction to Processes

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question