Darren D
darren at activebilling.com.au
Tue Mar 18 22:27:09 CDT 2008
Hi Arthur The %%X stuff looks way cool The If Exist and goto syntax options have worked beautifully The Batch file is now much smarter - I have incorporated this newly learned logic to many areas of the file - a lot more powerful and intuitive now Many many thanks - I am grateful Time for an article on the %%X stuff me thinks Darren -----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:39 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT:Batch File Syntax Oops. That was supposed to be %%x not %x%. And to hell with the suspense, here's an example: for %%x in (system, command, shellnew, system32) do dir "%windir%\%%x" /W This won't run straight from the command line. Save it as a file called fordemo.cmd and then run it. A. On 3/18/08, Arthur Fuller <fuller.artful at gmail.com> wrote: > > Whichever test you use, provided there is a goto then the other test is > not required -- unless of course you have more than one branch, in which > case you would need more than one IF since there is no equivalent to Select > Case: > > if exist c:\autoexec.bat goto Yupper > echo c:\autoexec.bat does not exist. > echo Your mother wears army boots. > echo Run as many commands here as you wish. When you're done... > goto Done > > :yupper > copy c:\autoexec.bat c:\autoexec.old > echo Do something else. > echo Do something else. > goto Done <---- this, in this example, is redundant, since the > next line is the Done label > > :Done > echo That's all for now, folks. > echo When you're ready for something really hip, ask me about for %x% > in(). > echo Batch languages are surprisingly powerful. > > Arthur -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com