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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

renaming files using an access module

Status
Not open for further replies.

shawnbaker

Programmer
Mar 1, 2007
2
US
Been trying to rename a file using the shell command in VBA

stAppName = "REN u:\ImportExport\bob fred"
Debug.Print stAppName
Call Shell(stAppName, 1)

However I get a file not found error.

The file exists, the drive is mapped, and I can rename it in the cmd window using the above line.

Any altrernitive methods would be good.
 
Straight VBA:
Name "u:\ImportExport\bob" As "u:\ImportExport\fred"

If you insist for the shell:
stAppName = "[!]CMD /C [/!]REN u:\ImportExport\bob fred"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top