Solved I have an - arrow in my copy command?

November 1, 2012 at 15:58:42
Specs: Windows 8 Pro x64, Intel Core 2 DUO , 8GB
So I have this command:

@echo off
set /p asd="File Name: "
copy %asd%.sav Battery/%asd%.sav.backup
echo your file name is %asd%.sav.backup and is located under Battery Folder.

the problem is the when I opened it using txt editor , I found an arror -> in the end of the outputted file, why?

Thanks!


See More: I have an - arrow in my copy command?

Report •


✔ Best Answer
November 2, 2012 at 03:00:54
Use:
echo f | xcopy "%asd%.sav" "Battery\%asd%.sav.backup" /Q /Y.
in replacement of the copy command you have.


#1
November 1, 2012 at 16:46:45
what text file? I didn't see any reference to one...
Probably not relevant to the issue, but it looks like your slash is pointing the wrong way, unless that's a windows-eight thing I'm unfamiliar with:
copy %asd%.sav Battery/%asd%.sav.backup


Report •

#2
November 1, 2012 at 22:14:31
Here's a better version (have no clue why you have the arrow) lol are you sure it isn't there to begin with? Anyway:
@echo off
set asd=?
set /p asd=File name:
copy "%asd%.sav" "Battery\%asd%.sav.backup"
echo.Your file name is %asd%.sav.backup and is located under Battery Folder.

Report •

#3
November 2, 2012 at 02:08:16
I agree about the slash and the mystery file.

Also, a colon in a file name is a bad idea.


====================================
Life is too important to be taken seriously.

M2


Report •

Related Solutions

#4
November 2, 2012 at 02:43:46
So I've done what #2 Said , and it tells me , Can't Copy File into Itself!??????????????

Report •

#5
November 2, 2012 at 03:00:54
✔ Best Answer
Use:
echo f | xcopy "%asd%.sav" "Battery\%asd%.sav.backup" /Q /Y.
in replacement of the copy command you have.

Report •

#6
November 2, 2012 at 03:35:25
Thanks ;) But what does f , | , /Q /Y mean?

Report •

#7
November 2, 2012 at 06:42:26
echo f is to automatically answer the prompt, | is used to transfer the input f.
/Q means to not show names of the files being copied and /Y means to not ask the user whether to overwrite the file or not.

Report •


Ask Question