Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rename application file
#1
Hi

Is there a way of renaming the application file itself while it is running? I saw somewhere a code snippet to do it and I think it is possible but I can't remember how.
#2
Well, if you're simply trying to rename the application file, using the FileSystem.Rename command.


You can use
[code2=vbnet]FileSystem.Rename(My.Application.ExecutablePath, "NewName.exe")[/code2]
--

I don't know if this will work while the application is running, but it's worth a shot!
My Blog | My Setup | My Videos | Have a wonderful day.
#3
Haha, it worked. Didn't know that it would do that without giving an exception that the file is in use.

Thank you very much
#4
brco900033 Wrote:Haha, it worked. Didn't know that it would do that without giving an exception that the file is in use.

Thank you very much

Wow, I honestly didn't expect it to either! Glad it worked!
My Blog | My Setup | My Videos | Have a wonderful day.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Copy file to clipboard brco900033 4 17,381 11-04-2012, 12:17 AM
Last Post: brandonio21
  How to make a GUI for a console/cmd application Cartman 2 12,441 10-30-2012, 05:36 PM
Last Post: brandonio21
  getting a file name form a save dialoge zmanalpha 3 14,120 08-04-2012, 03:15 PM
Last Post: brandonio21
  External Settings File brco900033 1 8,780 11-04-2011, 02:47 PM
Last Post: brandonio21
  Form/Application Store PsychicShadow 2 12,424 06-02-2011, 09:16 PM
Last Post: xolara

Forum Jump:


Users browsing this thread: 1 Guest(s)