# Search the Community

Showing results for tags 'Path'.

• ### Search By Tags

Type tags separated by commas.

### Forums

• General
• Announcements and Site News
• AutoIt v3
• AutoIt Help and Support
• AutoIt Technical Discussion
• AutoIt Example Scripts
• Scripting and Development
• Developer General Discussion
• Language Specific Discussion
• Operating System Deployment
• Windows Client
• Windows Server
• Office

### Categories

• AutoIt Team
• Beta
• MVP
• AutoIt
• Automation
• Databases and web connections
• Data compression
• Encryption and hash
• Games
• Hardware
• Information gathering
• Internet protocol suite
• Maths
• Media
• PDF
• Security
• Social Media and other Website API
• Windows
• Scripting and Development
• Operating System Deployment
• Windows Client
• Windows Server
• Office

• Forum FAQ
• AutoIt

### Calendars

• Community Calendar

• 0 Replies

• 0 Reviews

• 0 Views

Found 14 results

1. ## How do i get the .EXE name of the active window

I'm trying to build a script that will eventually create a log with time stamps of the active windows used on a workstation throughout the day, but I'm having a problem figuring out how to actually get this information. For example, if someone has Microsoft Word open, I'd like to be able to pop-up/log "word.exe" along with the full path to that file if at all possible (sort of like seeing the application DETAILS name in Windows Task Manager and being able to right-click on the name and choose "Open FIle Location" to get the full path to the file). Is what I'm asking even possible within the realm of AutoIt? I have the below script as a test that gets me the current active window handle and title in a message box every 6 seconds, but for the life of me, I don't know what code I need to use to get the actual .EXE name/path of the active window. #include <MsgBoxConstants.au3> Local $i = 0 Do Global$handle = WinGetHandle("[ACTIVE]") Global $title = WinGetTitle("[ACTIVE]") MsgBox(0,"Active Handle & Title",$handle & " - " & $title, 3)$i = $i + 1 Sleep(3000) Until$i = 100 Any help or suggestions would be greatly appreciated. I don't mind figuring out the code myself, if someone could just point me in the right direction. Thanks, TBWalker
2. ## Files Checklist

Files Checklist Just a simple little (complex enough) program I whipped up, for a purpose ... but only too happy to share. It can of course be modified to do more, but at the moment just compares file names with or without path ... Location versus Checklist. There are of course other compare programs out there, most doing a lot more than mine (i.e. WinMerge or FileComparer). But I wanted something quick and simple with drag & drop, that uses up a smallish amount of screen real estate. NOTE - The SAVE button is also a LOAD one, and displays 'Load' when the list is empty. So you can save and load specific lists. While in SAVE mode, the button can also be used with CTRL held down, to ADD another list to existing (displayed one) ... combining as they say ... though not saved until you SAVE. CLEAR button removes a selected entry, or if used with CTRL held down, queries about removing all listed entries. Files Checklist v1.2.zip Files Checklist v1.3.zip Files Checklist v1.4.zip (Includes a BUGFIX.) (source included) WARNING - While this program does not act on files or folders ADDED or CHECKED, you might act on the results, so I advise caution, and I also recommend using the new 'Relative' option in v1.3 or newer ... but you still need to understand what you are doing and what the results actually mean. Some basic examples in the next post. Enjoy! RELATED Users might also be interested in another somewhat related program of mine. DeleteIf Same Cheers!

11. ## Retrieve full file paths of files opened by a process!

Credits go to the authors of AutoIt Unlocker! #NoTrayIcon #include "WinAPIEx.au3" #include <WinAPI.au3> Dim $hTimer = TimerInit() Dim$aFiles = _ProcessListFiles("firefox.exe") ; Get a list of files currently opened by the process ConsoleWrite("+>Took " & Round(TimerDiff($hTimer)) & " milliseconds" & @CRLF) #include <Array.au3> _ArrayDisplay($aFiles) Exit Func _ProcessListFiles($vProcess,$nMaxFiles = 1000) Static Local $aPrivilege = DllCall("ntdll.dll", "int", "RtlAdjustPrivilege", "int", 20, "int", 1, "int", 0, "int*", 0) Local$nProcessId = ProcessExists($vProcess),$aRet Static Local $hCurrentProcess = _WinAPI_GetCurrentProcess() Local$aHandles = _WinAPI_EnumProcessHandles($nProcessId) Local$hObject, $aFiles[$nMaxFiles+1], $sPath Local$hProcess = _WinAPI_OpenProcess(0x0040, 0, $nProcessId, True) For$i = 1 To $aHandles[0][0] Step 1 If$aHandles[$i][3] = 0x00120189 Or$aHandles[$i][3] = 0x0012019f Or$aHandles[$i][3] = 0x00100000 Then ContinueLoop$hObject = _WinAPI_DuplicateHandle($hProcess,$aHandles[$i][0],$hCurrentProcess, 0, False, $DUPLICATE_SAME_ACCESS) If Not$hObject Then ContinueLoop If __IsFileObject($hObject) Then$sPath = __FileObjectPath($hObject) _WinAPI_CloseHandle($hObject) If FileExists($sPath) Then For$n = 1 To $aFiles[0] If$aFiles[$n] =$sPath Then $sPath = 0 ExitLoop EndIf Next If$sPath Then $aFiles[0] += 1$aFiles[$aFiles[0]] =$sPath If $aFiles[0] >=$nMaxFiles Then ExitLoop EndIf EndIf EndIf Next ReDim $aFiles[$aFiles[0]+1] Return $aFiles EndFunc Func __IsFileObject(ByRef$hObject) Static Local $tPOTI = DllStructCreate('ushort;ushort;ptr;byte[128]'),$pData, $Length,$tString Local $aRet = DllCall("ntdll.dll", 'uint', 'NtQueryObject', 'ptr',$hObject, 'uint', 2, 'ptr', DllStructGetPtr($tPOTI), 'ulong', DllStructGetSize($tPOTI), 'ptr', 0) If @error Or $aRet[0] Then Return$pData = DllStructGetData($tPOTI, 3) If Not$pData Then Return $Length = DllCall("kernel32.dll", 'int', 'lstrlenW', 'ptr',$pData) If @error Or Not $Length[0] Then Return$Length = $Length[0]$tString = DllStructCreate('wchar[' & ($Length + 1) & ']',$pData) If @error Then Return Return (DllStructGetData($tString, 1) == "File") EndFunc Func __FileObjectPath($hObject) Static Local $tStruct = DllStructCreate("char[255];") Local$aDrive = DriveGetDrive("ALL"), $sPath Local$aDrivesInfo[UBound($aDrive) - 1][2] For$I = 0 To UBound($aDrivesInfo) - 1$aDrivesInfo[$I][0] =$aDrive[$I + 1] DllCall("kernel32.dll", "dword", "QueryDosDevice", "str",$aDrivesInfo[$I][0], "ptr", DllStructGetPtr($tStruct), "dword", 255) $aDrivesInfo[$I][1] = DllStructGetData($tStruct, 1) Next Local Static$tPOTI = DllStructCreate("ushort Length;ushort MaximumLength;ptr Buffer;wchar Reserved[260];"), $sDeviceStr,$vSolid = False DllCall("ntdll.dll", "ulong", "NtQueryObject", "ptr", $hObject, "int", 1, "ptr", DllStructGetPtr($tPOTI), "ulong", DllStructGetSize($tPOTI), "ulong*", "")$sDeviceStr = DllStructGetData(DllStructCreate("wchar[" & Ceiling(DllStructGetData($tPOTI, "Length") / 2) & "];", DllStructGetData($tPOTI, "buffer")), 1) For $y = 0 To UBound($aDrivesInfo) - 1 If StringLeft($sDeviceStr, StringLen($aDrivesInfo[$y][1])) =$aDrivesInfo[$y][1] Then$sPath = StringUpper($aDrivesInfo[$y][0]) & StringTrimLeft($sDeviceStr, StringLen($aDrivesInfo[$y][1])) EndIf Next Return$sPath EndFunc Anonymous
12. ## GDI+ Text to Bezier Intro (CPU Benchmark Tool)

Eukalyptus the GDI+ guru ported the Warp Text to Splines to GDI+ (thread on German forum with examples). I had the idea to mix his example 7 with some GDI+ elements to create an old school Amiga style intro. Here how it looks: It is very CPU intensive and running with acceptable speed only on newer CPUs. Download: Text to Bezier Intro.7z (20 downloads previously) Use latest 7-Zip tool to extract archive properly. Source Code can be seen here: http://pastebin.com/U24ACRAr Credits: see scroller. To start the intro in benchmark mode either change line 23 or compile it and start it with one of following parameter: "/b", "/benchmark" or "/bench". Results will be written to Benchmark.txt in script dir. Here some benchmark results: Br, UEZ Change Log: 2013-05-01: some small modifications 2013-05-06: added benchmark mode
13. ## Open directory where current wallpaper is.

Hi ppl, just made this simple one because sometimes i want to access the wallpaper directory to do some modifications on wallpapers, and in win 7 it's not as easy to go there as i would likem so i made this simple script, got any sugestions of improvement? They're welcome. So here it goes, execute to open dir where the wallpaper you have displayed is: #include <File.au3> Local $Path,$szDrive, $szDir,$szFName, $szExt,$TestPath $Path = RegRead("HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerDesktopGeneral", "WallpaperSource")$TestPath = _PathSplit($Path,$szDrive, $szDir,$szFName, $szExt)$Path = $szDrive &$szDir ;MsgBox(4096, "", $Path, 10) ShellExecute ($Path) Hope you like it and that it may become useful for someone. EDIT: Removed the brackets as pointed out by guinness. Thanks, forgot that one. AutoIt Wallpaper.au3
14. ## Command to search for a specific file on the whole PC ??

I need to search for a certain file name "msflx.ocx" on the entire harddrive and to return its path. Is there any function or UDF for this ? I searched on the forums too but I wasn't satisfied with the results. thx
×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...