Onepissedpenguin Posted January 28, 2007 Posted January 28, 2007 Hi I have been trying this for ages. My USB drive has autorun.inf on it which contains: CODE[autorun] label=Aaron's Memory Stick. shell\runner = Open etc. shell\runner\command = run.exe shell=runner which means that when I double click on the drive in my computer, it starts run.exe instead of opening the drive to view the files. What I want is for it to do BOTH. Right now the first line of my script run.exe contains Send("{ALT}fo") ; when you double-click on the drive in My Computer, opens the drive by going File > Open. and this gets around the problem, but is very messy and I don't like it. Is there another way of performing the same action? For instance, how do i find out what command windows executes when I click "File > Open"? One major problem I have with this is that if you double click on run.exe directly it loops. Eagles may soar, but weasels don't get sucked into jet engines.
Uten Posted January 28, 2007 Posted January 28, 2007 (edited) ShellExecute?Something like:ShellExecute("explorer.exe")EDIT: After reading your post again I get the feeling I might have misunderstood what you want? Edited January 28, 2007 by Uten Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
Onepissedpenguin Posted January 28, 2007 Author Posted January 28, 2007 (edited) yes i had tried ShellExecute("explorer.exe","\") but it opens the contents of the drive in a new window - fine, but a little annoying. I wanted a way of making the drive open in the same explorer window. Edited January 28, 2007 by Onepissedpenguin Eagles may soar, but weasels don't get sucked into jet engines.
Shevilie Posted January 28, 2007 Posted January 28, 2007 (edited) If you want it to open in the same window you will have to identify the window.. I dont know if its a script only for you, if so use the ;Change "Denne Computer" to whatever its named at your place (My Computer) $MyComputer = "Denne computer" $Dir = StringLeft(@AutoItExe, 2) $handle = WinGetHandle($MyComputer) If @error Then ShellExecute("explorer.exe",$Dir) Else ControlSetText($handle, "", "Edit1", $Dir) ControlFocus($handle, "", "Edit1") ControlSend($handle, "", "Edit1", "{ENTER}") EndIf You might be able to do it via com objects, though i never tried Edited January 28, 2007 by Shevilie Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit
Onepissedpenguin Posted February 2, 2007 Author Posted February 2, 2007 that worked great, thanks Eagles may soar, but weasels don't get sucked into jet engines.
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