Jump to content

Recommended Posts

Posted
Local $oShell = ObjCreate("shell.application")
Local $oFolder = $oShell.Namespace($sFolderPath)
$oFolder.ParseName($sItemName).InvokeVerb("delete")

This code deletes the file, but does not do it permanently.Is there a way to modify this code so that it does it permanently.

Posted
On 6/28/2023 at 5:29 PM, Jos said:

Filedelete() ?

I know it about FileDelete @Jos 😀 ...but in my case i have to use the native delete method of windows.

Posted (edited)

Not sure why FileDelete doesn't suffice, but there is also a function in the WinAPI UDF you could look at in the Help File. 

_WinAPI_DeleteFile()

That's about as native as you can get.
https://www.autoitscript.com/autoit3/docs/libfunctions/_WinAPI_DeleteFile.htm

 

If you really want or have to use a COM object to delete a file, you may be better suited to use Scripting.FileSystemObject.

Edited by spudw2k

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
  • Recently Browsing   0 members

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