VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Prompt a user to rename a file thats on your desktop.

by Brandon (46 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 18th January 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Prompt a user to rename a file thats on your desktop.

Rate Prompt a user to rename a file thats on your desktop.



On Error GoTo Exception_Handler:
Dim PreviousFileName, NewFileName As String
PreviousFileName = "C:\Windows\Desktop\File1.txt"
NewFileName = InputBox("What do you wish to rename " & PreviousFileName & "?", "Rename File")
NewFileName = "C:\Windows\Desktop " & "\" & NewFileName & ".txt"
Name PreviousFileName As NewFileName
Exit Sub
Exception_Handler:
MsgBox Err.Description, vbCritical, "Error"



Download this snippet    Add to My Saved Code

Prompt a user to rename a file thats on your desktop. Comments

No comments have been posted about Prompt a user to rename a file thats on your desktop.. Why not be the first to post a comment about Prompt a user to rename a file thats on your desktop..

Post your comment

Subject:
Message:
0/1000 characters