Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

using variables with xcopy(new to MS DOS)

24 views
Skip to first unread message

Joshua Parker

unread,
May 7, 2016, 8:06:19 PM5/7/16
to
have no idea how to make it work




@echo off
title Backups
:a
set directory=default
echo What directory would you like to back up?
set /p directory=
set location=default
echo What directory would you like to back up to?
set /p location=
xcopy %directory% %location% /s
goto :a

Joshua Parker

unread,
May 7, 2016, 8:51:25 PM5/7/16
to
edit: @echo off
title Backups

:Directory
set /p directory=What directory would you like to back up?
set /p yn= you are sure you want to back up this file?
if "%yn%"==""(echo not entry) & (GOTO FILENAME)
if /I "%yn%"=="n" (GOTO FILENAME)
if /I "%yn%"=="y" (GOTO LOCATION) else (echo please input Y/N) & (GOTO FILENAME)




:location
set /p location=What directory would you like to back up to?

copy C:\%filename% "C:"

pause
0 new messages