Sign in to follow this  
Followers 0
uznut

File Rename Help

3 posts in this topic

I looked in the help file but i couldn't find anything that said how to rename file could some one help me out

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0