emendelson Posted August 4, 2013 Share Posted August 4, 2013 Is this a known problem, or something unique to my system? I have a C:TEMP folder on my system. If I use FileOpenDialog, and specify "init dir" as anything at all ("C:", @DesktopDir, etc.), the "init dir' is ignored, and the dialog always opens on C:TEMP. If I change the name of C:TEMP to anything else (C:TMP, for example), then FileOpenDialog works correctly. Does anyone have any idea of why this might be happening? Link to comment Share on other sites More sharing options...
FireFox Posted August 4, 2013 Share Posted August 4, 2013 (edited) Hi,Can you post the code?Edit: I guess your script is in the C:TEMP dir.Br, FireFox. Edited August 4, 2013 by FireFox Link to comment Share on other sites More sharing options...
emendelson Posted August 4, 2013 Author Share Posted August 4, 2013 (edited) Hi, Can you post the code? Edit: I guess your script is in the C:TEMP dir. Actually the code is in D:AutoItScripts, and this is enough to show the effect. $pclfile = FileOpenDialog("Select a PCL, PXL, or PRN file to convert to PDF", @HomeDrive & "\", "All (*.*)", 3) But I just realized that the problem occurs only when I run the script either from inside the editor or when I right-click on the script and choose Run Script. If I build the script as an executable and run the executable, then the problem does NOT occur. Again, this only occurs when C:TEMP exists, even when C:TEMP is completely empty. The script is not in C:TEMP, and the problem occurs when C:TEMP is empty. This is under Windows XP SP3, by the way. Edited August 4, 2013 by emendelson Link to comment Share on other sites More sharing options...
FireFox Posted August 4, 2013 Share Posted August 4, 2013 (edited) And what's the value of @HomeDrive/@WorkingDir (test them when it fails ofc) ? Edited August 4, 2013 by FireFox Link to comment Share on other sites More sharing options...
emendelson Posted August 4, 2013 Author Share Posted August 4, 2013 (edited) And what's the value of @HomeDrive/@WorkingDir (test them when it fails ofc) ? I added : MsgBox(0,"", @HomeDrive) MsgBox(0,"", @WorkingDir) The result is: @HomeDrive is C: @WorkingDir is D:AutoitScripts When run from the editor, and C:TEMP exists, the initial directory in the open file dialog is C:TEMP. When I rename C:TEMP to C:TMP, and run the script from the editor, the initial directory in the open file dialog is (correctly) @HomeDrive & "" - in other words, C:. I'm afraid I don't understand "test them when it fails ofc". Could you spell out what you're saying? Apologies for being so dense, and thanks for trying to help sort this out. Edited August 4, 2013 by emendelson Link to comment Share on other sites More sharing options...
FireFox Posted August 4, 2013 Share Posted August 4, 2013 (edited) I said test those macros only for the cases when the init dir is wrong. I suggest you to wait for someone else to pop-in or submit a trac here. Edited August 4, 2013 by FireFox Link to comment Share on other sites More sharing options...
emendelson Posted August 4, 2013 Author Share Posted August 4, 2013 (edited) I said test those macros only for the cases when the init dir is wrong. I suggest you to wait for someone else to pop-in or submit a trac here. I finally got around to something I should have tested earlier: I have a dual-boot machine, and so I booted to Windows 7 32-bit (on drive I:), with AutoIt installed in Windows 7 also, and the problem did not occur at all - even though I have an I:TEMP and a C:TEMP. So it has something to do with my XP environment, though I can't imagine what. C:TEMP isn't in any environmental variable. So it's very strange. Thanks again for trying to help sort this out. Edited August 4, 2013 by emendelson Link to comment Share on other sites More sharing options...
BrewManNH Posted August 4, 2013 Share Posted August 4, 2013 I tested this, and found that if I run this on any of the beta versions starting from at least 3.3.9.8, if you use FileOpenDialog in SciTE, navigate to a folder, and open a file from that folder. If you run it again from SciTE it will open the FileOpenDialog from that folder, and disregards the "init dir" parameter. It does not do this in 3.3.8.1. I don't know what version you're using but that's how I duplicated the problem. Also, running this on Windows 7 x64. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
FireFox Posted August 4, 2013 Share Posted August 4, 2013 Strange that the working dir is still the same when it occurs. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 4, 2013 Moderators Share Posted August 4, 2013 (edited) Hi,I cannot reproduce BrewManNH's symptoms on Vista x32 v3.3.9.14 - I get the requested "init dir" regardless of whether I open a file from within SciTE or not. @WorkingDir get changed as expected but the next FileOpenDialog opens as requested: ConsoleWrite(@HomeDrive & @CRLF) ; Shows C: ConsoleWrite(@WorkingDir & @CRLF) ; Shows M:\Program\Au3 Scripts $sFile = FileOpenDialog("test", @HomeDrive & "\", "All (*.*)", 3) ; Opens in C: ; Navigate to M:\Program\Au3 Scripts and select a file ConsoleWrite(@WorkingDir & @CRLF) ; Set to M:\Program\Au3 Scripts if a file is selected else unchanged ShellExecute($sFile) ; Open file in SciTE $sFile = FileOpenDialog("test", "D:\", "All (*.*)", 3) ; Opens in D: as requestedM23 Edited August 4, 2013 by Melba23 Added Autoit version Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
BrewManNH Posted August 4, 2013 Share Posted August 4, 2013 I just tried this on a second computer, also running Win7 x64, and I get the same results using 3.3.9.12. I don't know if this matters, although it shouldn't matter, but I'm running a portable version of AutoIt and not installing it. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 4, 2013 Moderators Share Posted August 4, 2013 BrewManNH,I am using v3.3.9.14 - have you tried with that? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
BrewManNH Posted August 4, 2013 Share Posted August 4, 2013 I just downloaded 3.3.9.15 and ran this script with it.$pclfile = FileOpenDialog("Select a PCL, PXL, or PRN file to convert to PDF", @HomeDrive & "\", "All (*.*)", 3) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : @HomeDrive & "\" = ' & @HomeDrive & "\" & @crlf & '>Error code: ' & @error & @crlf) ;### Debug ConsoleAnd, when I run it the first time, it opens at the root of the C drive, I then navigate from there to the C:Users folder, open a file from there and then hit ok. The script ends. I run the script a second time from Scite, and it opens at C:Users instead of C:. the @HomeDrive & "" string always says C: regardless of where the FileOpenDialog actually opens at. Everytime I run the script from SciTE I get the same thing to happen. Even if I close SciTE and rerun it, the same thing happens.I'm wondering if there's something going on with SciTE rather than AutoIt. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 5, 2013 Moderators Share Posted August 5, 2013 BrewManNH,Cannot reproduce those symptoms - that script always opens FileOpen Dialog in C: for me. Versions: AutoIt v3.3.9.15, SciTE v3.3.2.0, AutoIt3Wrapper v.2.1.2.24, Vista x32.You say this happens on a 64 bit system - do both the 32 and 64 bit AutoIt interpreters show the same behaviour? All,Can we get feedback from others please - particularly those who can test on both32 and 64 bit systems. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
guinness Posted August 5, 2013 Share Posted August 5, 2013 I tested using both the current beta and stable on Windows 7 x64 with using AutoIt.exe and AutoIt_x64.exe and I too can confirm what BrewManNH said. if you don't select any file then it doesn't occur. I believe it could be a Windows "thing"?! UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Joeit Posted August 5, 2013 Share Posted August 5, 2013 (edited) Run the script elevated(as administrator). Just noticed you were on XP. Nvm this. Problem seems to be: You have your script on one drive(D:) and you want to change dir. Should be 3. solutions 1. You need a drive parameter in order to change the drive (cd /D C:temp) 2. Run as administrator - running as administrator puts you in the C-drive (C:windowssystem32) iirc 3. Put your script in the C-drive. Hope it helps. This is all "should work" in my windows-head. Edited August 5, 2013 by Joeit Link to comment Share on other sites More sharing options...
trancexx Posted August 5, 2013 Share Posted August 5, 2013 This question may seem lame and unrelated, but why in the world you all add backslash to the folder path? Maybe that's the reason you get strange results. But surely it isn't, right? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Joeit Posted August 5, 2013 Share Posted August 5, 2013 (edited) This question may seem lame and unrelated, but why in the world you all add backslash to the folder path? Maybe that's the reason you get strange results. But surely it isn't, right? Makes no difference. You can use as many backslashes you want after the driveletter only. It's just aesthetics in a commandprompt. C:temp C:temp C:temp all the same, the backslash is used to separate path/folder-names, not drives. Makes sense? As for strange results using the backslash.. It should not make a difference, as you're using the cmdprompt from windows itself. Edited August 5, 2013 by Joeit Link to comment Share on other sites More sharing options...
trancexx Posted August 5, 2013 Share Posted August 5, 2013 (edited) ^^ I didn't say that. I asked "why in the world you all add backslash to the folder path"? Do you see the difference now? Lose the backslash and try then. It may not make the difference but still, do try. Edited August 5, 2013 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Ascend4nt Posted August 5, 2013 Share Posted August 5, 2013 Okay this is weird. I've tried Brewman's script on an installed version of AutoIt and it worked fine. Then I tried it on a portable version of AutoIt and it exhibited the weird 'remember last directory' behavior. I looked to see what the current directory was in the executable, and sure enough it was the directory that FileOpenDialog() had used on previous runs. But then! I went and ate, showered, shaved, got a bowl of cereal, read 20 newspapers, made 20 bowel movements (maybe at the same time ), and came back and tried the code again. But now everything was working perfectly fine! So that's a head-scratcher.. I'm wondering if some sort of Windows caching thing was going on or whatnot.. I dunno. I'll have to try it again after hitting the bathroom a few more times. My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) 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