Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rename a file in stored procedure...

Status
Not open for further replies.

bartee

MIS
Mar 20, 2005
147
US
I would like to copy a file from one directory to another and would like to accomplish this within a stored procedure.

There are a couple of issues that have be questioning the best method to accomplish this:

1. I will not know the exact name of the file but will know the naming convention it will follow. The naming convention includes the date (mmddyy) along with some variable text. EXAMPLE: 082106_test1.txt

2. Upon copying this file to the new directory, I want to rename the new file.


Is the xcopy command the best method for doing this? Can a wildcard (*) be used to identify the source file?

If so, could anyone provide an example of the correct syntax given the example above?

Any help is greatly appreciated.

Thank you very much in advance.
 
xcopy /F *utoexec.* c:\temp\

rename c:\temp\autoexec.bat autoexec1.bat


You can parameterise the xcopy depending on how you choose to execute it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top