Getting mad at different CMD / Batch behaviour

 
Thread Tools Search this Thread
Special Forums Windows & DOS: Issues & Discussions Getting mad at different CMD / Batch behaviour
# 1  
Old 09-18-2013
Getting mad at different CMD / Batch behaviour

I have these commands:

Code:
MOVE "C:\Users\Pascal\Dropbox\Public\U_PC_Backup\Anki Flashcards\[portable]Cameo_App_Virtualization\0backup\Cards_only\Card_Backup\" "C:\Users\Pascal\Dropbox\Public\U_PC_Backup\Anki Flashcards\[portable]Cameo_App_Virtualization\0backup\Cards_only\Card_Backup_%date%\"

Code:
xxcopy /E /Y "C:\Users\Pascal\Dropbox\Public\U_PC_Backup\Anki Flashcards\[portable]Cameo_App_Virtualization\0backup\Cards_only\Card_Backup\" "C:\Users\Pascal\Dropbox\Public\U_PC_Backup\Anki Flashcards\[portable]Cameo_App_Virtualization\Anki.virtual.data\VOS\Anki\%Personal%\Anki\" /PB

Code:
MOVE "C:\Ankiback\Anki" "C:\Users\Pascal\Dropbox\Public\U_PC_Backup\Anki Flashcards\[portable]Cameo_App_Virtualization\0backup\Cards_only\Card_Backup"

When launched directly from the Commandline they behave as I need them too.

However inside a batch file, the first outputs:
Code:
The file cannot be found


The second outputs:
Code:
Directories Processed = 51
Total Data in Bytes   = 97.037.744
Elapsed time in sec.  = 2.453
Action speed (MB/min) = 2.373
Files Copied          = 508
Exit code             = 0 (No error, Successful operation)


The third outputs:
Code:
The File cannot be found.
The File cannot be found


Last edited by pasc; 09-18-2013 at 04:14 PM..
# 2  
Old 09-18-2013
Variables behave differently in a batch file, you may need %% rather than %
# 3  
Old 09-18-2013
Yes, however, not all commands have a % in them.

What is with those without one, why won't they work in bat ?
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Going mad on an egrep command (Reg Expressions)

Dear community, I am trying for several hours now to create an egrep command to grep the number of lines containing a specific text from a text-file but seem to have an error somewhere. The Textfile contains several thousand lines and has the expression "Lastname" in several lines.... (3 Replies)
Discussion started by: Donzo
3 Replies

2. Windows & DOS: Issues & Discussions

Command works on CMD line but not in batch?

Hi All, This command works when I type it on but when I run the batch file it doesn't..any ideas why? attrib.exe * | find /c /v "" >filecount.txt (1 Reply)
Discussion started by: Grueben
1 Replies

3. Shell Programming and Scripting

Unix cmd prompt how to get old cmd run?

Hi, I am using SunOS I want to serch my previous command from unix prompt (like on AIX we can search by ESC -k) how to get in SunOs urgent help require. (10 Replies)
Discussion started by: RahulJoshi
10 Replies

4. Shell Programming and Scripting

Writing a 'Mad Libs' program using Ruby?

How would I go about writing a 'Mad Libs' type program using Ruby? Any examples would be greatly appreciated. Thanks! (0 Replies)
Discussion started by: greeky
0 Replies

5. UNIX for Dummies Questions & Answers

Using gzip and my speakers have gone mad!

Hello, I wanted to compress a directory which I did with: tar -czvf backup15062007.tar.gz backup15062007/ I knew that you could specify the compression level with gzip so I then did: gzip -cvf9 backup15062007.tar.gz backup15062007compress.tar.gz Now I know this probably won't... (5 Replies)
Discussion started by: patwa
5 Replies

6. UNIX for Dummies Questions & Answers

man <cmd> >> cmd.txt

I've noticed most of my postings here are because of syntax errors. So I want to begin compiling a large txt file that contains all the "man <cmd>" of the commands I most have problems with. I ran a "man nawk >> nawk.txt" but it included a header/footer on each "page". Anyone know how I'd be... (6 Replies)
Discussion started by: yongho
6 Replies

7. Shell Programming and Scripting

Simple test driving me mad!

Hi all, I have been writing a script to automate some work for myself and have come accross a problem. I cannot understand why it doesn't work, but then I am new to both Unix and Korn shell hacking! Here is the problem: I want to interogate a file for a number and store that number in... (6 Replies)
Discussion started by: alarmcall
6 Replies

8. HP-UX

HP-UX boxes - am I mad?

Greetings, and thanks for having such an interesting forum! I currently have 3 Intel boxes running 2000, and two HP boxes running HP-UX 10.20. I am very inexperienced with the Unix/Linux world. I have several problems, mainly in getting them all networked together. I am constrained to keep a... (3 Replies)
Discussion started by: Menace
3 Replies
Login or Register to Ask a Question