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

Chaning a file name

Status
Not open for further replies.

SSJpn

Technical User
Oct 7, 2002
259
US
Hi, I have a file called C:\Sierra\Counter-Strike\cstrike.exe which i often have to rename to C:\Sierra\Counter-Strike\cstrike-console.exe and then back again. This is a pain so i want a little application that will rename the file for me. Since I don't know much of anything about VB I was wondering if anyone could write the application for me. I don't think its too many lines of code???

thanks
 
Hi,
Use the Name Statement:

Dim OldName, NewName,TempName
OldName = "C:\Sierra\Counter-Strike\cstrike.exe "
NewName = "C:\Sierra\Counter-Strike\cstrike-console.exe " ' Define file names.

Private Sub NameChange()
Name OldName As NewName ' Rename file.
TempName = OldName
OldName = NewName
NewName = TempName ' if you need to change back
End Sub

Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top