Jump to content

SOLUTION: Deleting a file.


cyber7
 Share

Recommended Posts

Hi Guys

I am very new at AutoIt. After reading a lot of subjects regarding deleting a file, I have found a foolproof way.

(Background: I create robocopy.exe out of my exe if the user running my backup does not have it installed. BUT, I then want it deleted...)

The delete script removes robocopy out of the directory the script was started from:

$robodel = (@ScriptDir&"\"&"robocopy.exe")
$handle = FileOpen($robodel,0) ; Open handle
$noddefs = FileReadLine($handle) ; Use handle
FileClose($handle) ; Close handle
FileDelete($robodel)

Cheers and I am so glad I stumbled over AutoIT. I was looking at writing a backup for my users in vbs when I came across it.

Kind regards

Aubrey Kloppers

South Africa

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...