Darren D
darren at activebilling.com.au
Tue Mar 18 20:18:22 CDT 2008
Brilliant Old timers Rule Arthur :-) - We all know the Old Bull/Young bull Story Back to the Batch file Syntax Would this be a valid syntax construct? - I should test for both conditions - yes? ~~~~~~~~~~~~~~~~~~~~~~~~~~~ IF NOT EXIST c:\autoexec.bat go to FileNotExist IF EXIST c:\autoexec.bat go to FileExist --OR Should I just continue with the batch file here rather than test for EXIST FileExist: Merge File Syntax here FileNotExist: Copy file syntax here ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Many thanks Have a great day Darren ----------------- T: 1300 301 731 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Wednesday, 19 March 2008 12:09 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT:Batch File Syntax If exist is what you need. Here is an example: *IF EXIST c:\autoexec.bat echo Yupper *That is a simple example. For "echo Yupper", you can substitute something like "copy x:\my.dll %windir%/my.dll". You could also get fancy, create a label in the command file (e.g. a line that begins with a colon immediately followed by a label) and jump to it, like this: *IF EXIST c:\autoexec.bat goto mylabel echo Nosireee exit :mylabel **echo Yupper exit * hth, Arthur (See? There are some advantages to being an old timer.) On 3/18/08, Darren D <darren at activebilling.com.au> wrote: > > Hi All > > > > Apologies for the Off Topic post - moderators let me know if this is too > much of > a stretch :-) > > I am calling a batch file that does many many things > > One of the things it does is 'merge' a file we have to a file the OS > should have > > Sometimes the OS does not have this file So. > > I want to know the syntax in a batch file to test the existence of a file > and if > it exists to "X" if it doesn't do "Y" > > > > > > Many thanks > > > > DD > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com