Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-09-13
6
Medium Priority
?
248 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 600 total points
ID: 12043289
Perhaps something here will help you:
http:Q_10175070.html
http:Q_10083817.html
http:Q_10480178.html
0
 
LVL 59

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 200 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 4

Accepted Solution

by:
itcnbwise earned 200 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 59

Expert Comment

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

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

This is about my first experience with programming Arduino.
Make the most of your online learning experience.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

722 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