0

Hi, I'm getting a syntax error in the below script, on line #5. Can someone help me? I'm a novice in batch scripting.

echo off *****************************************************************
echo off *                                                               *
echo 0ff *   BATCH SCRIPT TO MOVE ING PH TO GP5000 (FULL PROCESS)        *
echo off *                                                               *
echo off *****************************************************************
for %%A in (%*) do if exist %%A copy %%A W:\IP5000_ING_2-up\Input Folder
W:
cd \IP5000_ING_2-up\Processed Docs on Success
choice /C X /T 120 /D X > nul
move /y *.* \IP5000_ING_2-up\ING_Tmp
cd \IP5000_ING_2-up\Processed Docs on Error
move /y *.* \IP5000_ING_2-up\ING_Tmp
cd \IP5000_ING_2-up\ING_Tmp
dir
move /y *.* \\10.0.238.197\Duplex\ING_Domtar_18inch
exit /b

1 Answer 1

1

echo off is a command on its own. To echo ouput, just use echo:

@echo off
echo *****************************************************************
echo *                                                               *
echo *   BATCH SCRIPT TO MOVE ING PH TO GP5000 (FULL PROCESS)        *
echo *                                                               *
echo *****************************************************************

Note that @ means 'echo off for this line only'. That way you can prevent echoing the echo off command itself.

On line with the for loop, there seems to be a problem too. Your path has a space in it, so I think it should be quoted. Also, I'm not sure about %*. Did you mean just * or *.*?

for %%A in (*.*) do if exist "%%A" copy "%%A" "W:\IP5000_ING_2-up\Input Folder"

The same goes for other paths in your script.

Sign up to request clarification or add additional context in comments.

2 Comments

Can I use * to grab whatever files are in the folder or if I use * will have the same effect?
I made the corrections and execute flawlessly with no errors, thank you very much for help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.