OhBobSaget

FileOpenDialog - preventing USB eject

6 posts in this topic

Hi,

I suspected for a long time a problem with the FileCopy function in AutoIT but finally found out that using the FileOpenDialog function leave a handle on the USB drive preventing the ejection.

Is there any way around this issue ?

I tried setting the FileOpenDialog variable to 0 or Null but i was not able to make it work.

It seems that if you get FileOpenDialog to obtain a list of files on a USB device it will result in creating a handle that i am unable to find and remove... :(

Any ideas ?

 

 

Share this post


Link to post
Share on other sites



it does not happend to me. Are you listening music while you run your code?

Maybe Window Media Player is using your USB. Every time that you insert a usb window Medis Player Gets it.

Saludos

Share this post


Link to post
Share on other sites

The FileOpenDialog () changes the workdir to the directory of the selected file, so do a FileChangeDir(@ScriptDir) after the selection is done.

Jos

2 people like this

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@Jos For me it is not changing the working directory. I use Autoit 3.3.12.0  It does. lol Sorry

I'm sure that was  OhBobSaget's problem. with Jos's answer the problem should be solved.

Also Take a look about I said about Window Media Player.

Saludos

Edited by Danyfirex

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

The FileOpenDialog () changes the workdir to the directory of the selected file, so do a FileChangeDir(@ScriptDir) after the selection is done.

Jos

Thank you so much :) @Jos You really did it !

@DanyFirex ( No i am not listening to music with Windows Media Player while coding, sometime online music streaming stuff )

Thank you for your answers !

 

Edited by OhBobSaget

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