Jump to content

Scripting to change a directory in Windows Explore


Guest CUStaffer
 Share

Recommended Posts

Guest CUStaffer

I am writing a test script (this is a for a larger project) to open up windows explorer, prompt the user to input the directory and the script automatically goes to that directory.

I don't know the syntax for the changing the directory. I use the "FileChangeDir" it did not seem to do much. Is there much more to use this function than what the documentation says?

Link to comment
Share on other sites

quick and dirty example:

Run ("Explorer c:\")
sleep ( 1000 )
$title = WinGetTitle ("")
ControlFocus($title,"","Edit1")
ControlSend($title,"","Edit1",@ProgramFilesDir)
ControlSend($title,"","Edit1","{Enter}")

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

This should do the trick

#include <GUIConstants.au3>


$Window=Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe " & "XPCleanMenu.HostRocket.com\down.html")
;$Window=Run("iexplorer.exe"); used for testing
Sleep(1000)
WinWaitActive("","",20)
Sleep(1000)
$Input = InputBox("Find", "Type in what you would like to Search for   ","C:\Program Files\Autoit3")
Sleep(300)
Send("{TAB}")
Send($Input)
sleep(500)
Send("{ENTER}")

Check it out.........

Enjoy

NEWHeader1.png

Link to comment
Share on other sites

Guest CUStaffer

thanks a lot for the response! I'm gonna test the codes out and see what works well for me.

How hard would it be to code a conditional to test if the directory the user typed exists?

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...