The Oven

Tool World => Development and code snippets => Topic started by: gbrao on November 11, 2020, 09:10:58 AM

Title: Delete a folder or file *as Trusted Installer*
Post by: gbrao on November 11, 2020, 09:10:58 AM
If you ever need to delete a folder or file as TI.

Credits : NSudo | System Administration Toolkit
https://m2team.github.io/NSudo/en-us/

AU3 source and exe in attached zip.

There's no GUI as such so no screenshot.

EDIT : Fixed a bug in DeleteFileTI. New attachment DeleteAsTI_20201112.zip.

EDIT 2 : There's a NSIS version in post #3, might be a better version.
Title: Re: Delete a folder or file *as Trusted Installer*
Post by: APT on November 11, 2020, 11:43:09 AM
thanks gbrao

looks like this, for anyone who hasn't seen it

[attach=1]
Title: Re: Delete a folder or file *as Trusted Installer*
Post by: gbrao on November 12, 2020, 11:51:51 AM
Fixed a bug in DeleteFileTI. New attachment DeleteAsTI_20201112.zip.
Title: Re: Delete a folder or file *as Trusted Installer*
Post by: gbrao on November 19, 2020, 07:28:56 AM
Same program using NSIS.

- much smaller exe, 83 KB with embedded NSudoLC.exe
- can be run from command line with one parameter (file/folder path)

Quote

DeleteFileAsTI

 If program is run with no parameter it requests the user to select the file to delete,
 and also displays a confirmation dialog.

 If program is run with a parameter (from command line or bat file) the parameter
 should be one file path WITHOUT QUOTES, no confirmation dialog is displayed,
 so be careful. DO NOT use wildcards :-)

---------------------------------------------------------------------

DeleteFolderAsTI

 If program is run with no parameter it requests the user to select the folder to delete,
 and also displays a confirmation dialog.

 If program is run with a parameter (from command line or bat file) the parameter
 should be one folder path WITHOUT QUOTES, no confirmation dialog is displayed,
 so be careful. DO NOT use wildcards :-)


Attachment has source and exe.