OhBobSaget Posted July 22, 2015 Share Posted July 22, 2015 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 ? Link to comment Share on other sites More sharing options...
Danyfirex Posted July 22, 2015 Share Posted July 22, 2015 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 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Developers Jos Posted July 22, 2015 Developers Share Posted July 22, 2015 The FileOpenDialog () changes the workdir to the directory of the selected file, so do a FileChangeDir(@ScriptDir) after the selection is done.Jos OhBobSaget and valdemar1977 2 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. Link to comment Share on other sites More sharing options...
Danyfirex Posted July 22, 2015 Share Posted July 22, 2015 (edited) @Jos For me it is not changing the working directory. I use Autoit 3.3.12.0 It does. lol SorryI'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 July 22, 2015 by Danyfirex Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
KaFu Posted July 22, 2015 Share Posted July 22, 2015 OhBobSaget 1 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
OhBobSaget Posted July 23, 2015 Author Share Posted July 23, 2015 (edited) The FileOpenDialog () changes the workdir to the directory of the selected file, so do a FileChangeDir(@ScriptDir) after the selection is done.JosThank 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 July 23, 2015 by OhBobSaget 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