Sign in to follow this  
Followers 0
bobbintb

dirremove error

7 posts in this topic

#1 ·  Posted (edited)

now this doesnt always happen but a lot of the time. i run a script to install a program and then i have it delete the start menu folder. the folder does get deleted but much of the time (again not always) i get this window.

Posted Image

here is my script:

ShellExecuteWait("C:\hkSFVsetup.exe", "/S")
RegWrite("HKEY_CURRENT_USER\Software\Big-O\hkSFV", "BadFiles", "REG_DWORD", 0)
RegWrite("HKEY_CURRENT_USER\Software\Big-O\hkSFV", "UseCache", "REG_DWORD", 0)
RegWrite("HKEY_CURRENT_USER\Software\Big-O\hkSFV\WindowPlacement", "Main", "REG_BINARY", "000000000000000000000000000000000000000001000000")
DirRemove(@ProgramsDir&"\hkSFV",1)
Edited by bobbintb

Share this post


Link to post
Share on other sites



How would this be an AutoIt3 BUG ?

Do you have Windows Exlorer open on the directory that is deleted by the script ?

I am moving this to support ...


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

You will definitely see that error if you have a folder opened in an explorer window and some other process deletes it (the folder).

Share this post


Link to post
Share on other sites

You will definitely see that error if you have a folder opened in an explorer window and some other process deletes it (the folder).

ive never had that, it just closes the windows for me.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

How would this be an AutoIt3 BUG ?

Do you have Windows Exlorer open on the directory that is deleted by the script ?

I am moving this to support ...

it does show the window open but thats not the problem. in windows if a folder that is being veiwed is deleted it just closes the window. sometimes it deletes the folder and closes the window and other times it gives me the error. look at the script. it does a silent install and immediately deletes the start menu folder because i dont need them cluttering up my start menu. its a problem with autoit because at times it attempts to delete the folder more than once, causing an error in explorer because it cant delete whats already deleted.

Edited by bobbintb

Share this post


Link to post
Share on other sites

Why you are using ShellExecuteWait() on an executable file rather then RunWait() is beyond my understanding but I will alert you that explorer will error on being requested to open a non existing folder. The installer of hkSFV does attempt to open an explorer window after the installation and when you immediately delete the folder, then a error is produced. Best concept to do is to handle the window first, then delete the folder. This issue goes way back with installers being a troublesome with opening explorer, readmes, browsers etc at end of install so issues do happen unfortunately due to their existence of being an event.

Lets open file\folder donotexist

ShellExecute('c:\donotexist')

The above ShellExecute is how the installer opens the shortcut folder so produces the error when does not exist as well.

:)

Share this post


Link to post
Share on other sites

Why you are using ShellExecuteWait() on an executable file rather then RunWait() is beyond my understanding but I will alert you that explorer will error on being requested to open a non existing folder. The installer of hkSFV does attempt to open an explorer window after the installation and when you immediately delete the folder, then a error is produced. Best concept to do is to handle the window first, then delete the folder. This issue goes way back with installers being a troublesome with opening explorer, readmes, browsers etc at end of install so issues do happen unfortunately due to their existence of being an event.

Lets open file\folder donotexist

ShellExecute('c:\donotexist')

The above ShellExecute is how the installer opens the shortcut folder so produces the error when does not exist as well.

:)

ah that makes sense. thanks. i just assumed it was double executing the command. i guess sometimes it deletes the folders too quickly. ill just have to put in a delay and wait for the window to come up. and ive had issues before using runwait with a switch so its just easier with the shell. i dont think theres really much of a difference in terms of usage anyway. just how it does it. correct me if im wrong.

Share this post


Link to post
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
Sign in to follow this  
Followers 0