Tassadar930 Posted May 30, 2015 Share Posted May 30, 2015 Hello, I created an SFX archive using the dialog box in WinRAR. I checked the box for Request administrator access, which corresponds to the command-line switch -iadm. I also ran the SFX as administrator from the context menu. Win7. UAC disabled. However, in all instances, the bat file returns an "Access denied" message for the same line (del OriginatingArchive). From what I understood, it was possible to delete an SFX archive by calling a batch file with the SFX archive, after it finishes extracting? Unless the SFX archive is still in use, until whatever program it called upon was finished executing? Otherwise it's a privilige issue. Any help anyone can give would be appreciated. Link to comment Share on other sites More sharing options...
jaclaz Posted May 30, 2015 Share Posted May 30, 2015 You are basically trying to self delete an executable file?I doubt it will work that way.You probably want to read this:http://www.catch22.net/tuts/self-deleting-executables jaclaz 1 Link to comment Share on other sites More sharing options...
Tassadar930 Posted June 4, 2015 Author Share Posted June 4, 2015 That's exactly what I want to do. Thanks for the link, I'll take a look at it later. Link to comment Share on other sites More sharing options...
Tassadar930 Posted June 7, 2015 Author Share Posted June 7, 2015 Got it working. Just schedule the SFX to chainload a batch file with the following script:Repeatdel "C:\ProgramData\SFX Installer II.exe"if exist "C:\ProgramData\SFX Installer II.exe" goto Repeatdel "C:\Program Files (x86)\batch.bat"And it'll work. Taken from the site linked here. (Thought so. SFX unloads from memory separate of whatever script/executable it calls on. There's just a tiny delay between when the program is finished running and calls upon the batch file, and when Windows actually unloads it from memory.) Link to comment Share on other sites More sharing options...
jaclaz Posted June 8, 2015 Share Posted June 8, 2015 Got it working. Good ,to be picky, personally I wouldn't trust much hardcoded paths, particularly the "C:\Program Files (x86)" one, del "%~dpnx0"should be more "flexible". jaclaz 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now