batch file help forum

January 11, 2011 at 19:22:41
Specs: Windows 7
I wanted to use "xcopy" to make a backup batch file, but I don't want to specify an absolute path. I want to use a relative directory name. Can anyone tell me how to write this batch file?


See More: batch file help forum

Report •

January 11, 2011 at 19:56:36
Rough draft. source is drive\dir\files c:\stuff\*.*
destination is drive\dir

bat creates a file called x.bat.....create and open with notepad to be sure the bat below is working the way you want it to


@echo off
color 2f
echo Xcopy Bat
echo Type in source IE c:\*.txt hit enter
echo Then type in destination IE G:\backup
echo When finished hit enter twice
set FILES=
set /p FILENAME=Enter the files to copy: 
echo Your input was: %filename%

set INPUT=
set /P INPUT=Type destination input: %=%
echo Your input was: %INPUT%

echo xcopy %filename% %INPUT% /D /E /C /R /H /I /K /Y >>temp.txt
ren temp.txt x.bat


Report •

January 11, 2011 at 20:13:56
Well, because of the lack of information you supplied, I'm not sure if worldlibrary solved your problem or not.

You said the folders are relative, relative to what? You may want to check out variables like %userprofile%.

Can I put a question here?

Report •

Related Solutions

Ask Question