sbrady Posted March 26, 2014 Share Posted March 26, 2014 I have a need to open multiple folders. The name changes everyday. Their names each include todays date. So the folder structure would look like this. PM Exports 03-25-14 OPEN Exports 03-25-14 NDP Exports 03-25-14 Bumper Exports I need to cycle through the PM Exports folder and open each folder that has the date in the folders name. I have working code to open and place a window ;open promo AM NPR folder ShellExecute($promo_AM_NPR_Folder ) $thepath2 = ($promo_AM_NPR_Folder ) $hHandle3 = WinWait("", $thepath2) WinMove($hHandle3, "", 500, 600, 400, 500) I have code to get todays date ; month $the_month = @MON ;12 ;the day $the_day = @mday ;18 ;the year $the_year = @YEAR ;2012 $the_year2 = StringTrimLeft ($the_year,2);12 local $todays_export = $the_month & "-" & $the_day & "-" & $the_year2 ;12-18-12 MsgBox (4096, "The Date", $todays_export);12-18-12 can someone help me loop through the PM EXports folder. Thanks. Link to comment Share on other sites More sharing options...
sbrady Posted March 26, 2014 Author Share Posted March 26, 2014 here is the code that used when I started this project over a year ago but nerver finished. expandcollapse popup;open daily promo folders #include <File.au3> #include <Array.au3> ; month $the_month = @MON ;12 ;the day $the_day = @mday ;18 ;the year $the_year = @YEAR ;2012 $the_year2 = StringTrimLeft ($the_year,2);12 local $todays_export = $the_month & "-" & $the_day & "-" & $the_year2 ;12-18-12 MsgBox (4096, "The Date", $todays_export);12-18-12 ;============================================================ $promo_list = "\\10.10.44.160\Daily 700 Club Promos\Audio Exports\PM Exports" $all_promos = _FileListToArray($promo_list) Local $todays_promo_list[1] Local $1030ViewFolder_list[1] For $i = 1 To $all_promos[0] ;the [0] element holds the count If StringInStr($all_promos[$i], $todays_export) Then ;NEXTDAY 12-18-12 ;_ArrayAdd($1030ViewFolder_list, $all_promos[$i]) _ArrayAdd($todays_promo_list, $all_promos[$i]) ElseIf StringInStr($all_promos[$i], "OPEN") Then _ArrayAdd($todays_promo_list, $all_promos[$i]) ElseIf StringInStr($all_promos[$i], "NEXTDAY") Then _ArrayAdd($todays_promo_list, $all_promos[$i]) ElseIf StringInStr($all_promos[$i], "NDP") Then _ArrayAdd($todays_promo_list, $all_promos[$i]) ElseIf StringInStr($all_promos[$i], "BUMP") Then _ArrayAdd($todays_promo_list, $all_promos[$i]) ElseIf StringInStr($all_promos[$i], "BMP") Then _ArrayAdd($todays_promo_list, $all_promos[$i]) EndIf Next ;_ArrayDisplay($todays_promo_list, "promos") ;this array has ALL promos MsgBox (4096, "The Date", "hi") Link to comment Share on other sites More sharing options...
BrewManNH Posted March 26, 2014 Share Posted March 26, 2014 Why do you need to open the folders? What are you doing in the folders that requires them to be opened in Windows Explorer that can't be done some other way? 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...
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