mr-es335 Posted Tuesday at 05:29 PM Posted Tuesday at 05:29 PM (edited) Good day, I have been employing the following script for some time: ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- ; For Dual Monitors Global $Firstix = 2000, $Secondix = 2410, $Thirdix = 3020, $Fourthix = 3430 ; --------------------- Global $iTimeOut = 100 ; --------------------- Global $sRootAIFolder = "D:\App_Install\Digital_Audio" ; ----------------------------------------------- AI_RMLLabsFunc() ; ----------------------------------------------- Func AI_RMLLabsFunc() Local $sFunctionsFolder = $sRootAIFolder & "\1_RMLLabs\Functions" Local $sFunctionsText = $sRootAIFolder & "\1_RMLLabs\Functions\Functions.txt" Local $sSuppportFolder = $sRootAIFolder & "\1_RMLLabs\Support" ; ----------------------------------------------- ; Launch and position the functions folder ShellExecute($sFunctionsFolder) Sleep($iTimeOut) WinMove($sFunctionsFolder, "", $Firstix, 200, 400, 700) ; ----------------------------------------------- ; Launch and position the text ShellExecute($sFunctionsText) Sleep($iTimeOut) WinMove($sFunctionsText, "", $Secondix, 200, 600, 700) ; ----------------------------------------------- ; Launch and position the support folder ShellExecute($sSuppportFolder) Sleep($iTimeOut) WinMove($sSuppportFolder, "", $Thirdix, 200, 400, 700) EndFunc ;==>AI_RMLLabsFunc ; ----------------------------------------------- Note: The above example DOES NOT WORK as expected, whilst the following example DOES: ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- ; For Dual Monitors Global $Firstix = 2000, $Secondix = 2410, $Thirdix = 3020, $Fourthix = 3430 ; --------------------- Global $iTimeOut = 100 ; --------------------- Global $sRootAIFolder = "E:\Desktop\Digital_Audio\1_RMLLabs" ; ----------------------------------------------- AI_RMLLabsFunc() ; ----------------------------------------------- Func AI_RMLLabsFunc() Local $sFunctionsFolder = $sRootAIFolder & "\Functions" Local $sFunctionsText = $sRootAIFolder & "\Functions\Functions.txt" Local $sSuppportFolder = $sRootAIFolder & "\Support" ; ----------------------------------------------- ; Launch and position the functions folder ShellExecute($sFunctionsFolder) Sleep($iTimeOut) WinMove($sFunctionsFolder, "", $Firstix, 200, 400, 700) ; ----------------------------------------------- ; Launch and position the text ShellExecute($sFunctionsText) Sleep($iTimeOut) WinMove($sFunctionsText, "", $Secondix, 200, 600, 700) ; ----------------------------------------------- ; Launch and position the support folder ShellExecute($sSuppportFolder) Sleep($iTimeOut) WinMove($sSuppportFolder, "", $Thirdix, 200, 400, 700) EndFunc ;==>AI_RMLLabsFunc ; ----------------------------------------------- I am at a complete loss to understand why? Does AutoIt! maintain some kinds of hidden "recent files history" somewhere? The only thing that is different i the above two examples are the source paths. Edited Tuesday at 05:49 PM by mr-es335 mr-es335 Sentinel Music Studios
water Posted Tuesday at 06:17 PM Posted Tuesday at 06:17 PM I suggest to check for errors returned by SheellExecute. mr-es335 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
mr-es335 Posted Tuesday at 11:03 PM Author Posted Tuesday at 11:03 PM Done! mr-es335 Sentinel Music Studios
Resiak1811 Posted Tuesday at 11:43 PM Posted Tuesday at 11:43 PM try : ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- ; For Dual Monitors Global $Firstix = 2000, $Secondix = 2410, $Thirdix = 3020, $Fourthix = 3430 ; --------------------- Global $iTimeOut = 100 ; --------------------- Global $sRootAIFolder = "E:\Desktop\Digital_Audio\1_RMLLabs" ; ----------------------------------------------- AI_RMLLabsFunc() ; ----------------------------------------------- Func AI_RMLLabsFunc() Local $sFunctionsFolder = $sRootAIFolder & "\Functions" Local $sFunctionsText = $sRootAIFolder & "\Functions\Functions.txt" Local $sSuppportFolder = $sRootAIFolder & "\Support" ; ----------------------------------------------- ; Launch and position the functions folder ShellExecute($sFunctionsFolder, "", "", "open", @SW_SHOW) ; <------------------ Sleep($iTimeOut) WinMove($sFunctionsFolder, "", $Firstix, 200, 400, 700) ; ----------------------------------------------- ; Launch and position the text ShellExecute($sFunctionsText, "", "", "open", @SW_SHOW) ; <------------------ Sleep($iTimeOut) WinMove($sFunctionsText, "", $Secondix, 200, 600, 700) ; ----------------------------------------------- ; Launch and position the support folder ShellExecute($sSuppportFolder, "", "", "open", @SW_SHOW) ; <------------------ Sleep($iTimeOut) WinMove($sSuppportFolder, "", $Thirdix, 200, 400, 700) EndFunc ;==>AI_RMLLabsFunc ; -----------------------------------------------
water Posted Wednesday at 07:31 AM Posted Wednesday at 07:31 AM 8 hours ago, mr-es335 said: Done! And the result of this check is? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
robertocm Posted 7 hours ago Posted 7 hours ago (edited) Try this instead of ShellExecute Here some code for ideas: expandcollapse popup#===== Automating Windows Explorer ===== #include "Includes\FileExplorer.au3" Global $sDir, $hExplorer Global $sRootPath = "\\SomePath\" Func Abrir_Carpeta($Row) $sDir = "SomeDir" ;$sDir = _GUICtrlListView_GetItemText($idListview, $Row, 8) ;Subz, Feb 18, 2017 ;https://www.autoitscript.com/forum/topic/187110-runshellexecute-windows-folder-locations/?do=findComment&comment=1343796 ;https://www.autoitscript.com/forum/topic/169931-detect-specific-process-id-and-wait-until-process-finishes/#comment-1241733 ;https://www.autoitscript.com/forum/topic/199354-how-to-open-a-folder-in-current-explorer-window ;Xenobiologist, Oct 21, 2020 ;https://stackoverflow.com/questions/64417468/object-shell-application-open-folder-in-same-explorer-window ;~ #include <Array.au3> ;~ Opt("SendKeyDelay", 1) ;5 milliseconds ;~ Opt("SendKeyDownDelay", 1) ;1 millisecond ;~ $pid = ShellExecute("explorer.exe ", @DesktopDir) ;~ Sleep(300) ;~ ;$aWinList=WinList("[REGEXPCLASS:(Explore|Cabinet)WClass]") ;~ ;_ArrayDisplay($aWinList) ;~ ConsoleWrite($pid & @CRLF) ;~ $handle = _WinGetHandleByPID($pid) ;~ Sleep(2000) ;~ SendKeepActive($handle) ;~ Send('{F4}') ;~ Send('^a') ;~ Send(@AppDataCommonDir & "{ENTER}") If $hExplorer = 0 Then ;ShellExecute("Explorer.exe", "\\SomePath\" & $sDir, "", $SHEX_OPEN) Run("explorer.exe " & $sRootPath & $sDir) ;jguinch, Apr 27, 2015 ;https://www.autoitscript.com/forum/topic/169931-detect-specific-process-id-and-wait-until-process-finishes/?do=findComment&comment=1241930 $hExplorer = WinWait("[REGEXPTITLE:(?i)\Q" & $sDir & "\E$]", "", 10) ;ConsoleWrite($hExplorer & @CRLF) Else If WinExists($hExplorer) Then If Not WinActive($hExplorer, "") Then WinActivate($hExplorer) WinWaitActive($hExplorer, "", 5) ;WinSetState($hExplorer, "", @SW_MAXIMIZE) Sleep(500) EndIf If WinActive($hExplorer, "") Then ;~ SendKeepActive($hExplorer) ;~ Send('{F4}') ;~ Send('^a') ;~ Send(@AppDataCommonDir & "{ENTER}") ;~ SendKeepActive("") ;~ If ControlSend($hExplorer, "", "", "{F4}") = 1 Then ;~ ;ConsoleWrite("OK ControlSend" & @CRLF) ;~ ;Sleep(10) ;~ ControlSend($hExplorer, "", "", "^a") ;~ ;Sleep(10 ;~ ControlSend($hExplorer, "", "", "^a") ;~ ;Sleep(10) ;~ ControlSend($hExplorer, "", "", $sRootPath & $sDir) ;~ ;Sleep(10) ;~ ControlSend($hExplorer, "", "", "{ENTER}") ;~ Else ;~ ConsoleWrite("Error ControlSend" & @CRLF) ;~ EndIf ;LarsJ, Jul 9, 2020 ;https://www.autoitscript.com/forum/topic/203313-automating-filewindows-explorer-and-desktop/ ;File/Windows Explorer on Windows 7, 8, 10 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then ConsoleWrite("Could not find window. Terminating." & @CRLF) Return EndIf ;Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating File/Windows Explorer and Desktop", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf WinActivate( $hExplorer ) WinWaitActive( $hExplorer ) ;Get other interfaces GetShellInterfaces() ;Set current folder to desktop Local $pPath = _WinAPI_ShellILCreateFromPath($sRootPath & $sDir) SetCurrentFolder( $pPath , $SBSP_ABSOLUTE ) ; Free memory _WinAPI_CoTaskMemFree( $pPath ) EndIf Else ;ShellExecute("Explorer.exe", $sRootPath & $sDir, "", $SHEX_OPEN) Run("explorer.exe " & $sRootPath & $sDir) ;jguinch, Apr 27, 2015 ;https://www.autoitscript.com/forum/topic/169931-detect-specific-process-id-and-wait-until-process-finishes/?do=findComment&comment=1241930 $hExplorer = WinWait("[REGEXPTITLE:(?i)\Q" & $sDir & "\E$]", "", 10) ;ConsoleWrite($hExplorer & @CRLF) EndIf EndIf EndFunc ;==>Abrir_Carpeta Edited 7 hours ago by robertocm
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