Error: 0x80041002 -
Source: SWbemServicesEX
Description: Not Found
Help File: (null)
HelpContext: 0
Specifically: Get
on line 14
FolderSecuritySettings := ComObjGet("winmgmts:").Get("Win32_LogicalFileSecuritySetting='" . A_loopfilefullpath . "'")
Any help would be appreciated, thanks!!
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
ShawnCounter := 1
RobertCounter := 1
LynkCounter := 1
StephenCounter := 1
LenCounter := 1
loop, \\192.168.168.1\plats\PDF DRAWINGS\*.PDF {
FolderSecuritySettings := ComObjGet("winmgmts:").Get("Win32_LogicalFileSecuritySetting='" . A_loopfilefullpath . "'")
VarSetCapacity(objRef, A_PtrSize, 0)
if !FolderSecuritySettings.GetSecurityDescriptor(ComObjParameter(0x4009, &objRef, 1)) {
objRef := NumGet(objRef)
SD := ComObj(objRef)
owner := SD.Owner.Domain . "\" . SD.Owner.Name
msgbox %owner%
ObjRelease(objRef)
if (owner = "EPSI\stoews"){
++ShawnCounter
}else if (owner = "EPSI\rtornhom"){
++RobertCounter
}else if (owner = "EPSI\drafter2"){
++LynkCounter
}else if (owner = "EPSI\drafter"){
++StephenCounter
}else if (owner = "EPSI\lmark"){
++LenCounter
}
}
}
msgbox Shawn %ShawnCounter% `nLen %LenCounter% `nBob %RobertCounter% `nLynk %LynkCounter% `nStephen %StephenCounter%
THANKS!
Shawn Toews