jeyes56 Posted December 1, 2010 Posted December 1, 2010 (edited) hi, im new to the forum, but im using the autoit over a year and now i have encountered a thing that i can't figure how to deal with, i've create program that ask the user to search for the file (open file dialog) so that the program can locate the file. $loc = FileOpenDialog("LOCATE YOUR FILE",@DesktopDir,"All Files(*.*)") MsgBox(0,"",$loc) this code is working fine at a windows XP, and it returns the exact file location. ex. File needed : c:\new folder\my file.exe Shortcut file: c:\documents and settings\(username)\desktop\my file.lnk Msgbox output: c:\new folder\my file.exe but in win7 it is not returning the exact file needed but the shortcut file itself ex. File needed : c:\new folder\my file.exe Shortcut file: c:\documents and settings\(username)\desktop\my file.lnk Msgbox output: c:\documents and settings\(username)\desktop\my file.lnk does my code is wrong? or the program is bug? or i'm missing something about win7? ::: I already downloaded the latest autoit installer. (12-1-2010) Edited December 1, 2010 by jeyes56
BrewManNH Posted December 1, 2010 Posted December 1, 2010 It works for me in Windows 7, I get the .exe file for any shortcut I click on or double click on. Same as on XP. 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
jeyes56 Posted December 1, 2010 Author Posted December 1, 2010 what have you did? because im using two win7 os both ultimate, why is it always returning to me the link file,? what is the version of your win7?
jeyes56 Posted December 1, 2010 Author Posted December 1, 2010 oh im sorry, i posted a wrong code: $loc = FileOpenDialog("LOCATE YOUR FILE",@DesktopDir,"All Files(*.*)") MsgBox(0,"",$loc) <<-- the code above is working correctly... is should be like this $loc = FileOpenDialog("LOCATE YOUR FILE",@DesktopDir,"(*my files*)") MsgBox(0,"",$loc)
jeyes56 Posted December 1, 2010 Author Posted December 1, 2010 (edited) oh im sorry, i posted a wrong code: $loc = FileOpenDialog("LOCATE YOUR FILE",@DesktopDir,"All Files(*.*)") MsgBox(0,"",$loc) <<-- the code above is working correctly... is should be like this $loc = FileOpenDialog("LOCATE YOUR FILE",@DesktopDir,"(*my files*)") MsgBox(0,"",$loc) oh sh8, im becoming dumb, i forgot the .exe at the last,, now i fixed my program, $loc = FileOpenDialog("LOCATE YOUR FILE",@DesktopDir,"(*my files.EXE*)") MsgBox(0,"",$loc) thank you for reply, and sorry for messing out here with wrong conclusion without analyzing thoroughly the situation.. :::: nothing is a bug, didn't miss anything about win7, but: my code is wrong ^^ Edited December 1, 2010 by jeyes56
BrewManNH Posted December 1, 2010 Posted December 1, 2010 That code doesn't work because the file filter is written wrong, it doesn't show any files just folders when I use it. Also, if the first code works correctly, then there obviously isn't a problem with the FileOpenDialog function, it must be a problem with your code. If the first code works ok, then use that instead of what you wrote in the second example. Also, I tested it on Windows 7 Professional, and on XP Professional. 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
jeyes56 Posted December 1, 2010 Author Posted December 1, 2010 That code doesn't work because the file filter is written wrong, it doesn't show any files just folders when I use it. Also, if the first code works correctly, then there obviously isn't a problem with the FileOpenDialog function, it must be a problem with your code. If the first code works ok, then use that instead of what you wrote in the second example.Also, I tested it on Windows 7 Professional, and on XP Professional.thank you for reply sit ^^
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