Jump to content

File Rename Help


Recommended Posts

  • 2 years later...

If you can jot that down on your todo list, you might indicate that MoveFile() is what we use here to rename a file too.

Maybe you can also use an object to do stuff with files like you would be familiar with if you have done vbscript. Like here:

http://www.doorways.dk/caspdoc/html/vbscript_file_object.htm

Here's how I was gonna do this before I found this post. Here's my test thing. Just a test here, not a real script.

Func deleteme()
    $fso = ObjCreate('Scripting.FileSystemObject')
    $f = $fso.getfile("test.exe")
    $f.name = "deleteme.exe"
EndFunc
HotKeySet ('z', "deleteme")
while 1 
    sleep(100)
    
WEnd

I compile it to .exe and the file that's running can rename itself. Of course it could not delete itself. But it can rename itself, then download a newer version and kill the gui and start the new version and when the new version starts it can check for 'deleteme.exe' and delete it.

You know . . . for autoupdates.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...