Jim Lawrence
accessd at shaw.ca
Mon May 2 20:52:29 CDT 2005
Hi Penn: Given a batch file name 'test.bat' below are the contents of this file: if not exist c:\DevFileX.txt goto end c: cd\ ren DevFile.txt DevFileX.txt :end Line 1, checks to see whether the file DevFileX.txt exists on the root of the C drive. If it does the file can not be renamed over an existing file. Line2, places the program on the c drive if it is not already so. If the file exists already got to the end of the batch file. Line3, places the program in the root directory of the c drive. Line4, renames the file DevFile.txt that exists on the c drive on the root directory to a file named DevFileX.txt. Line 5, Is the label 'end' at the end of the batch file which the first line send control to if certain conditions are meet. This is a very primitive example but it should give you the idea. HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Penn 227 Sent: Monday, May 02, 2005 2:10 PM To: Access Developers discussion and problem solving Subject: [AccessD] OT: Create .bat in WinXP Pro This is completely off topic but I can't find any answers on the web and thought perhaps someone on the list had experience with it. I would like to automate renaming a file. I tried writing a batch file but it didn't work. ******* Batch File ****** run cmd cd c:\ ren DevFile.txt DevFileX.txt exit ***** End ***** Any ideas greatly appreciated. Penn __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com