TormentoRobots 0 Posted January 16, 2013 (edited) Maybe these Snippets would interest the Wiki team, well mostly work in progress, and some pulled from the Snippets Wikiexpandcollapse popup#Include-once ; compilation & script originals created by TormentoRobots 2013 #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Process.au3> Global $TZ_APPNAME = @scriptname Func _FolderPropigate($targetDir, $LUID) Run(@comspec & " /k " & "cacls.exe" & ' "' & $targetDir & '"' & " /t /e /g " & '"' & $LUID & '"' & ":F", @ScriptDir, @SW_SHOW) EndFunc Func _AddLimitedUser($sName, $sPassword = '', $sGroupName = 'Users', $iAutoLogon = 0) ; Creates user accounts. TODO - script must contain #requireAdmin If Not FileExists(EnvGet('AllUsersProfile') & '\..\' & $sName) Then RunWait(@ComSpec & ' /c ' & _ 'Net User ' & $sName & ' ' & $sPassword & ' /add &&' & _ 'Net LocalGroup ' & $sGroupName & ' ' & $sName & ' /add &' & _ 'Net Accounts /MaxPwAge:UnLimited', '', @SW_HIDE) EndIf EndFunc Func TZpowerconfigHack() local $TZreg = "HKEY_USERS\.DEFAULT\Control Panel\PowerCfg" local $TZkey = "CurrentPowerPolicy" ;#2 - always ON local $powerprof_Presentation = 2 ;TODO: add regread() to update this variable properly RegWrite($TZreg, $TZkey, "REG_SZ", $powerprof_Presentation) EndFunc Func _BrowseForFolder($fncdest = @homedrive) Local $ret = FileSelectFolder("Choose a folder", "", "", $fncdest) Return $ret EndFunc Func _ProcExists($ProcNm) Dim $prclist = ProcessExists($ProcNm) If $prclist = 0 then Return 0 Else Return 1 Endif EndFunc Func ATIModeENABLE() local $MOMapp = "C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\MOM.exe" local $CLIApp = "C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\CLI.exe" local $CLIDir = "C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\" local $x = 2 while $x > 0 if ProcessExists("MOM.exe") then Run($CLIApp & ' Start Load profilename="TV SIGNAL ENABLED"') else Run($MOMapp) sleep(10000) endif $x = $x - 1 wend EndFunc Func ATIModeDISABLE() local $MOMapp = "C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\MOM.exe" local $CLIApp = "C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\CLI.exe" local $CLIDir = "C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\" local $x = 2 while $x > 0 if ProcessExists("MOM.exe") then Run($CLIApp & ' Start Load profilename="TV SIGNAL DISABLED"') else Run($MOMapp) sleep(10000) endif $x = $x - 1 wend EndFunc Func EndMultiProcs($proc, $strComputer=".") $oWMI=ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2") $oProcessColl=$oWMI.ExecQuery("Select * from Win32_Process where Name= " & '"'& $Proc & '"') For $Process In $oProcessColl $Process=$Process.Terminate Next For $Process In $oProcessColl $Process=$Process.Terminate Next For $Process In $oProcessColl $Process=$Process.Terminate Next EndFunc ; functions below NOT tested , just pasted Func ParseCommandLine() if $CLIswitch[0] < 1 then Return local $i for $i = 1 to $CLIswitch[0] ;MsgBox(0, "command", $CLIswitch[$i], 1) if $CLIswitch[$i] then if $i = 1 then $njob = $CLIswitch[1] endif if $i = 2 then $nuser = $CLIswitch[2] MsgBox(0, $drvletter , $targetserver, 1) endif if $i = 3 then $npass = $CLIswitch[3] endif endif next EndFunccoming soon:Heres what Im working on as of lately:Winamp File Copy : copies currently playing file or filename in clipboard , (optionally from Winamp) to a folder (example, your MP3 player) with Just a clickfeatures :- GUI for adjusting parameters:destination & winamp settingsnetwork Mnt automatic mounting of network shares , features a config file and GUI for generating of config Edited January 18, 2013 by TormentoRobots #Include-once;TormentoRobots Share this post Link to post Share on other sites
guinness 1,518 Posted January 16, 2013 Use [autoit][/autoit] tags when posting AutoIt code. Thanks. UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Share this post Link to post Share on other sites
TormentoRobots 0 Posted January 16, 2013 thx will do that! #Include-once;TormentoRobots Share this post Link to post Share on other sites
guinness 1,518 Posted January 16, 2013 Ah you're new so you can't edit your post until you have 5 or more entries, I believe. Just bare in mind for the future. Welcome to the Forum. UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Share this post Link to post Share on other sites
Shaggi 25 Posted January 17, 2013 Whats the need for _ProcExists? Standard ProcessExists() works as _ProcExists() in boolean evaluations (I assume that's why you convert it to a boolean value)? Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG Share this post Link to post Share on other sites
guinness 1,518 Posted January 17, 2013 They're not even converting it to boolean, just 0 or 1. I can't really see the need where you would want to know if the process exists, but don't require the PID. UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Share this post Link to post Share on other sites
Shaggi 25 Posted January 18, 2013 Well it is boolean, but not an boolean datatype.. But i guess some people maybe use the if func() = 1 syntax Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG Share this post Link to post Share on other sites
guinness 1,518 Posted January 18, 2013 True. UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Share this post Link to post Share on other sites
TormentoRobots 0 Posted January 18, 2013 yes I have already noticed the same thing ! #Include-once;TormentoRobots Share this post Link to post Share on other sites
TormentoRobots 0 Posted January 18, 2013 (edited) expandcollapse popup#Include-once ; compilation & script originals created by TormentoRobots 2013 #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Process.au3> Global $TZ_APPNAME = @scriptname Func _FolderPropigate($targetDir, $LUID) Run(@comspec & " /k " & "cacls.exe" & ' "' & $targetDir & '"' & " /t /e /g " & '"' & $LUID & '"' & ":F", @ScriptDir, @SW_SHOW) EndFunc Func _AddLimitedUser($sName, $sPassword = '', $sGroupName = 'Users') If Not FileExists(EnvGet('AllUsersProfile') & '\..\' & $sName) Then RunWait(@ComSpec & ' /c ' & _ 'Net User ' & $sName & ' ' & $sPassword & ' /add &&' & _ 'Net LocalGroup ' & $sGroupName & ' ' & $sName & ' /add &' & _ 'Net Accounts /MaxPwAge:UnLimited', '', @SW_HIDE) EndIf EndFunc Func TZpowerconfigHack() local $TZreg = "HKEY_USERS\.DEFAULT\Control Panel\PowerCfg" local $TZkey = "CurrentPowerPolicy" ;#2 - always ON local $powerprof_Presentation = 2 ;TODO: add regread() to update this variable properly RegWrite($TZreg, $TZkey, "REG_SZ", $powerprof_Presentation) EndFunc Edited January 18, 2013 by TormentoRobots #Include-once;TormentoRobots Share this post Link to post Share on other sites