Jump to content

Access issues with bat file invoked from SFX archive


Recommended Posts

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


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

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

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

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