KioskeaKioskeaCommentCaMarcheSign up, it's free !
Wednesday July 9, 2008 - 2:50:33 am BST
Batch files does not execute
par queenss
 Threaded discussions
Statut : Not resolved
Monday March 10, 2008 12:08:49 PM
Hello,
I've a batch file that executes properly when i open cmd and paste it in.
but when i create a .bat and put it this command in, it does not execute or pauses after the end. it just closes the window.

any idea how to go about this problem?

if exist c:\1.txt del c:\1.txt
dir /b /s d:\ | find ".pst" >> c:\1.txt
dir /b /s e:\ | find ".pst" >> c:\1.txt

for /f "usebackq delims==" %a in ('c:\1.txt') do xcopy "%a" "\\testscala\g\"%username%"_backup\My Documents\" /y /r /c /e >>\\testscala\g\%username%_backup\backuplog.txt
Configuration: Windows XP
Internet Explorer 6.0
Reply to queenss  Report this message to moderators Go to last message

1


  • This message seems useful, vote!
  • Report this message to moderators
By Mrhack, on Tuesday March 11, 2008 04:25:49 PM Threaded discussions 
You have to prefix internal variables with double % in batches, i.e. %%a not %a as while executing at prompt.
Reply to Mrhack
Currently no message on this subject
Reply
Message title :
Your nick:
Your E-mail :
Message: 
  •  
  •  
Options: Get the answers by mail.
 

Help