Jump to content

Batch File Help Pleeze


Recommended Posts

First off, let me start by saying i've never dabbled too far in scripting beyond the most basic tasks, so please be easy on me :D

Here's what I'm trying to do..

I'm not at the point of trying to create an unattended Windows install yet. What I am attempting to do is create an application CD that contains various Applications, Codecs, .dll's and a few add-ins. In a nutshell, an "auto-run" cd with the fancy interface.

My issue is not with the standard installers, it's with the "stand-alone" applications (and the add-ins, ect.) that you usually extract into their own directory. Since this is something that will install from the CD-Rom drive, the drive letter might differ from time to time. My thought was to create a simple batch file that will use the xcopy command to copy the directory on the CD to the desired directory on the Hard Drive. The issue that I'm having is how would you go about aquiring this & place it into the batch file.

I've got this much so far, but I haven't gotten it to do what I want done.

set /p userin=Please Enter Your CD-Rom Drive Letter and Press Enter:  

xcopy /e /s /w %userin%:\Support_Apps C:\Support_Apps

I would appreciate any guidance & maybe a little help with the commands. I would honestly love to have the file discover the drive on it's own, but my searches have yeilded nothing :(

Appreciate your time & assistance!

Link to comment
Share on other sites


If you are auto starting a cd the batch file needs no drive letter.

As long as your batch file is in the root of the cd, or it's in the root of a folder containing the folder with the apps (standalone exe, and/or subfolders)

Use a path relative to the batch file's location.

eg: (With the batch file in the root of the cd, and the folder"Support_Apps" in the root of the cd)

xcopy Support_Apps C:\Support_Apps /e /s /w

(note: switches belong at the end of the command)

eg:

xcopy Support_Apps C:\Support_Apps /i /s /h /y /q

I like to keep it quiet, get all files/folders, and not show errors or file copying to the user,.... me.

Link to comment
Share on other sites

Hi Indignity, welcome to MSFN!

You really don't need to know the drive letter here if you are installing from the cd. Just use the generic "\" without the drive and colon, that always refers to the current drive.

Are you doing this to learn how to do it, or do you just want something to use? In either case you might want to take a look at X-Plode util here on MSFN

http://www.msfn.org/board/index.php?showforum=86

Link to comment
Share on other sites

DotBet, thanks that's what I was looking for... Much appreciated(especially the feedback on the switches)!!!!

dman, I'll look into that... for now, this is for me and maybe a friend or two, but that's it.

And thanks for the welcome... actually been reading topics here for some time, but not actually dove into doing something myself.

{edit} I need to read the license agreement... doh!!{/edit}

Link to comment
Share on other sites

  • 2 months later...

This will set the cd varible for you

for %%i in (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do if exist %%i\SETUP.exe set CDROM=%%i
You can install the app from cd instead of the copy to harddrive.

Example

Echo off && CLS && Mode 55,5 && Color 5e

for %%i in (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do if exist %%i\SETUP.exe set CDROM=%%i

start /w %cdrom%\Your-App-Name-Folder1\Your-App-To-Install1

start /w %cdrom%\Your-App-Name-Folder2\Your-App-To-Install2

start /w %cdrom%\Your-App-Name-Folder3\Your-App-To-Install3

exit

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...