Jump to content

Recommended Posts

Posted

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 ?

 

 

Posted

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

  • Developers
Posted

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

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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
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

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...