Jump to content

Recommended Posts

Posted

Hi. I have a shared folder open on a PC that runs 24/7. The host PC that the folder resides on sleeps from 10PM to 7AM daily. On the PC the folder is open, the content changes to show my network once the host PC sleeps. Normally every morning I would then click the back button in Explorer to get the contents of the folder back, but I'd like to write a script and have AutoIt do that instead. Is that possible? I've tried a few different things like If $OpenExplorer = ("Network") Then Send, ("{ALT}{LEFT}") and FileSelectFolder but I have not been successful. Any tips would be greatly appreciated!

Posted

@Nine This is what I'm currently trying, but I keep getting an "error parsing function call" message. Sorry if it's not in the correct format...

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.14.5

 Restore folder after host resumes from sleep

#ce ----------------------------------------------------------------------------

WinActivate ("Network")


If WinActive ("Network") Then ControlSend, ("{ALT}{LEFT}")

Posted

This doesn't display an error, but it also doesn't appear to pass the ALT+Left arrow command, as my network is still displayed.

If WinExists("Network") Then
    WinActivate("Network")
Send ("{ALT}{LEFT}")
Else

EndIf

Posted

@Nine Thank you for the reply, but I can't get that to work either. I can manually click the Explorer back button and get back to the folder contents, and I can also use the back button on my mouse. However the script doesn't appear to do anything as the network structure remains listed in the window.

Posted (edited)

I'm on Win 8.1 and there was no change with your latest script. I've tested it with the Explorer window minimized and opened. How are you testing it?

Also, when I have the Explorer window open and run the script from Documents, I don't see the network window become activated (it's displaying it's background color). Should I see that change when WinActivate is called?

Edited by paul1965
Posted
3 minutes ago, Nine said:

could you show the console after running my last script ?

I am not familiar with that. I am only running the script by right clicking and selecting "Run Script".

Posted

Ah.  Right click on the script and open/edit.  You should be in Scite then.  Make sure your Explorer is in Network.  Come back to Scite and press F5.   The console is at the bottom, enlarge to see all messages.  Select all info, copy it and paste it here.

Posted

Thanks for that info. Not much to show, but here it is:

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Paul\Documents\RestoreFolder.au3"    
>Exit code: 0    Time: 1.073

Posted (edited)

Ok it seems it doesn't find the window Explorer in Network.  You MUST be in the network otherwise it will not work.  You could try to WinList() all your windows and _ArrayDisplay them all.  You should see what is the problem.  Please show all the Scite console with all version info (everything).

Edited by Nine
Posted (edited)

I had previously verified that AutoIt finds the Explorer window with title "Network" and Handle 0x000F088A. I haven't used _ArrayDisplay but will try that next.

 

image.png.fbed9d08e6a76697bdfbdeda7b5686ad.png

Edited by paul1965
Posted
Posted

I'm running AutoIt Version 3.3.14.5, SciTE-Lite Version 3.5.4. WinList clearly found the window titled Network as shown in my screenshot, I never said the code found it.

Posted (edited)
26 minutes ago, Jos said:

why should we even when participating in this forum? ;) 

lol. I really wanted to use AutoIt. I wrote some scripts for Thunderbird to use for custom email notifications and they work fantastic. But for some reason the script refused to see the network folder. AHK saw it right away, restored it, clicked the back button, then minimized it using it's restored network folder name. The script has been converted to an .exe file and a task created to run it every morning.

Edited by paul1965

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
×
×
  • Create New...