Input cd drive letter to copy file

Hewlett-packard Hp pavilion dv9000 lapto...
June 15, 2011 at 00:51:54
Specs: XP, P4 3Ghz 3G ram
I've searched for this first.
I have a repeated tasks that copy data from the windws cd to the xp windows directory.
If you have a better way, please suggest something else.
I need user input for the cd drive and then combine it with a known path.
the path is cddrive:\i386\ntldr and copy to windows path
Can it automatically find the windows path too? How do I combine the windows path with a specific path?

variable1 = windows path
path=variable1+\system32\ (our destination path)
copy cddrive:\i386\ntldr path(c:\windows\system32\)

I will modify the path for other batch files.
Thank you for your help!

What I have so far is;
@echo off & setLocal EnableDELAYedeXpansion
echo Please load your windows disk in the cd drive
IF %~d0==C: (
SET /P L="Please enter your drive letter, then press ENTER: "
SET L=!L!:
ECHO Your drive letter is: !L!
) ELSE (
SET D=%~d0

The Computer Dr
Chris Robertson

See More: Input cd drive letter to copy file

Report •

June 15, 2011 at 05:56:11
You can use the %WinDir% System variable to get the installation path of the executing Windows system. %WinDir% will include the %SystemDrive% letter plus the directory name for the Windows installation.

On another note, I would strongly suggest NOT using "path" as a variable name, since it is already defined as a System variable. To see all defined System and User environment variables, open a command window, and issue the SET command with no arguments. You'll want to avoid reusing any of those variable names, unless you know and understand the consequences.

When your only tool is a hammer, every problem looks like a nail.

Report •
Related Solutions

Ask Question