Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am trying to add a line in a batch file which files from a certain directory will be copied if a certain condition exists, but, they do not seem to execute, this is being used on a network, here is the command:
echo Policy Member
echo -------------
echo Updating system, please wait . . .
if exist c:\corel\suite8\ xcopy32 n:\policies\updates c:\ /d /s /e /c /i /q /h /r /k /y > nul:
if exist c:\corel\office7\ xcopy32 n:\updates c:\ /d /s /e /c /i /q /h /r /k /y /u >nul:if NOT exist c:\windows\system\odma32.dll copy c:\docsopen\progs\odma32.dll c:\windows\system\ > nul
if NOT exist c:\windows\odma.dll xcopy32.exe c:\docsopen\progs\odma.dll c:\windows > nul
Any and all assistance would be greatly appreciated.

Say! You code like me.......long LOL!
The best way to debug a bat is break it down.
Example:
Note I have made a few test changes as well.
I have also put in a few remscls
@echo off
if exist c:\corel\suite8\ goto excop
rem suite8\ ???? (<--suite8\*.*)
goto end
rem If you do not assign a place to go if C:\corel does not exist it will go to the next line of code and exicute it. An if exist
should have ,,,,,by habit a second destination.What if it does not exist and the next line of code is y|Format C . So give an if exist
a place to go if it does and if it does not
exist. (picky picky picky LOL LOL)echo if exist c corel being tested.
pause >nul
:excop
echo we are at excop
pause >nul
xcopy32 n:\policies\updates c:\ /d
rem How about xcopy32 c:\policies\updates\*.*
c:\somwhere > nul:
I know putting in "echo we are here or there" is a bummer, but it will help find the errors.Thought:
if exist C:\corel\ is a incompleate line. if exist C:\corel\stuff.dat is compleateA open \ with no file or *.* wildcards can bring a bat to a screaming halt.
I hope this is of some help.
But I do like your style of code. Wish some one would help me debug my bats.
I also wish the reply box was a little bigger.
Peace Goodwill and Happy ComputingWorld Library

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |