Jump to content

jguinch

Active Members
  • Posts

    2,000
  • Joined

  • Last visited

  • Days Won

    13

jguinch last won the day on January 22 2022

jguinch had the most liked content!

3 Followers

About jguinch

  • Birthday 05/13/1979

Profile Information

  • Member Title
    Pause café

Recent Profile Visitors

1,887 profile views

jguinch's Achievements

  1. There are two steps to perform the job: 1 - Installing the driver Two ways : - use #RequireAdmin - allow non-administrators to install printer drivers. That second way can be done using a group policy like this : How to edit a GPO to edit the Driver Installation policy to allow non-admins to install printers (4225529) (oneidentity.com) 2 - Installing the printer First, you have do understand what kind of printer you want to install. Is it a local printer or a shared printer ? If it's a shared printer, it's not necessary to elevalate privileges (so no need of #RequireAdmin). Just use _PrintMgr_AddWindowsPrinterConnection per user no per computer If it's a local printer (using a TCP/IP port), you will need to use #RequireAdmin
  2. Hello @Celina76. Thanks for your message. In fact, the _ArrayAssign function is only useful in very rare cases. I think you have a 99.9% chance of not needing it. I advise you to use the native array declaration method, and in particular ReDim which will allow you to resize an array and therefore add rows easily
  3. Just a loop : Local $aExt = ["*.d2s","*.key","*.ma0","*.ma1","*.ma2","*.ma3","*.map"] For $ext in $aExt FileCopy("C:\Users\------\Saved Games\Diablo II\" & $ext, "F:\Game Backup\Diablo II") Next
  4. Here is one way : Local $hTimer = TimerInit() Local $sSource = "C:\Users\opc\Desktop\src\10GB_1.bin" Local $sDestination = "C:\Users\opc\Desktop\target\" _FileCopy($sSource, $sDestination) Local $fDiffInSec = TimerDiff($hTimer)/1000 Func _FileCopy($src, $dest) Local $oShell = ObjCreate("shell.application") $oShell.namespace($dest).CopyHere($src,256) EndFunc
  5. There is a simple way using the "__COMPAT_LAYER" environment variable, but it does not work with all programs. Example here, if you want to run regedit without privileges : EnvSet("__COMPAT_LAYER", "RunAsInvoker") Run("regedit.exe") Run application without elevation ('Run As Administrator') (nirsoft.net)
  6. @mandriospo 1. No, it's not possibile with this UDF for the moment. Although interesting, this feature is a little more complicated to implement. Unfortunately, I don't have the time right now for this. 2. This is not a bug. I just consider that if there is no printer that matches the search, it's not an error. The _PrintMgr_PrinterExists function is used precisely to ensure that the printer exists 3. Sometimes, exe file can be unpacked using 7Zip or other applications. Please, try it
  7. Added _SetCategory function, to set the category of a network (Public, Private, Domain)
  8. Here is a way to do it without using any external command (just use COM objects) #RequireAdmin ; Needed _NetSetCategory("LAN", 1) ; Sets the Private category to the network connection called "LAN" ; #FUNCTION# ==================================================================================================================== ; Name...........: _NetSetCategory ; Description....: Sets the category of a network. Changes made take effect immediately ; Syntax.........: _NetSetCategory($sNetworkId, $iNetCategory) ; Parameters.....: $sNetworkId - Name of the network connection ; $iNetCategory - New category of the network. Can be one of : ; 0 : Public ; 1 : Private ; 2 : Domain ; Return values..: Success - 1 ; Failure - 0 and sets the @error flag to non-zero ; Remarks........: The function requires administrator privileges ; =============================================================================================================================== Func _NetSetCategory($sNetworkId, $iNetCategory) Local $iRet = 1, $iNetFound = 0, $oNetwork, $oNetConnection If Not IsAdmin() Then Return SetError(4, 0, 0) If Not IsInt($iNetCategory) Or $iNetCategory < 0 Or $iNetCategory > 2 Then Return SetError(5, 0, 0) Local $INetListManager = ObjCreate("{DCB00C01-570F-4A9B-8D69-199FDBA5723B}") If Not IsObj($INetListManager) Then Return SetError($iRet, 0, 0) Local $oNetConnections = $INetListManager.GetNetworkConnections() If IsObj($oNetConnections) Then For $oNetConnection In $oNetConnections $oNetwork = $oNetConnection.GetNetwork If $oNetwork.GetName = $sNetworkId Then $iNetFound = 1 Execute("$oNetwork.SetCategory($iNetCategory)") $iRet = (@error ? 2 : 0) EndIf Next If Not $iNetFound Then $iRet = 3 EndIf $INetListManager = 0 If $iRet Then Return SetError($iRet, 0, 0) Return 1 EndFunc ; ===> _NetSetCategory Inspired from @Danyfirex code (thanks)
  9. Can you try this in command line (in elevated cmd): md c:\Windows\Temp\wifi cd /d c:\Windows\Temp\wifi netsh wlan export profile key=clear so you will have one xml file per SSID, in c:\windows\temp\wifi. You can now parse each XML file to get the informations you need. Not sure it contains the key...
  10. Anyway, all Windows 10 users using a supported version (except the LTSC version) will be affected by the removal of Internet Explorer on June 15, 2022 https://docs.microsoft.com/en-us/lifecycle/announcements/internet-explorer-11-end-of-support
  11. What about the end of life of Internet Explorer ? From June 15, 2022, Internet Explorer will disappear from Windows 10 through Windows Updates - only for currently supported versions except LTSC version. Has anyone been able to test the AutoIt fonctions related to Internet Explorer with Windows 11? It seems that some functions will no longer work, maybe it would be wise to identify them and add a comment in the help file ?
  12. @TheXman : what about asking Powershell to to the whole job ? (replacement of " and without temp file) #include <Constants.au3> Local $PS_CMD = "(Get-Process|where{$_.MainWindowTitle}|select MainWindowHandle,Id,ProcessName,MainWindowTitle,Handles -first 4|ConvertTo-Csv -NoTypeInformation -Delimiter '|')-replace '""""', ''" $iPid = Run(StringFormat('powershell -command "%s"', $PS_CMD), "", @SW_HIDE, $STDOUT_CHILD ) ProcessWaitClose($iPid) $sOut = StdoutRead($iPid) ConsoleWrite($sOut)
  13. @Deye : Here is another way : $s = StringRegExpReplace($sVar, "\s+:\s+", "|") $cols = StringRegExpReplace($s, "(?s)^\R+|\|\K\N+\R(?!\R)||\|\N+\R{2,}.+", "") $values = StringRegExpReplace($s, "\R\w+|\R\K\R\w+\||\R+$", "") $result = $cols & $values ConsoleWrite($result & @LF)
  14. There is a way to do what you want, without having to close the session or the explorer, through the Local Group Policies. The Local Group Policies are stored in .pol format. The good new is that Microsoft provides a command line tool called "LGPO.EXE", which can interact with this kind of file. Download LGPO.exe : https://www.microsoft.com/en-us/download/details.aspx?id=55319 (LGPO.zip) Create a NoViewContextMenu.txt file, as indicated bellow Build a policy file from the text file, using the following command : LGPO.exe /r NoViewContextMenu.txt /w NoViewContextMenu.pol Import the policy in the Local Group Policy (it's a user policy, so use /u) with that command : LGPO.exe /u NoViewContextMenu.pol (you will need Admin rights) That's all. The next step is to automate it using AutoIt (the steps 1 to 3 have to be done just one time) NoViewContextMenu.txt ; Disable the context menu User SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer NoViewContextMenu DWORD:1 Warning : since the Home edition of Windows does not support the Local Group Policy editor, I don't know if it works with this tool Edit : I didn't try to execute the script using a different account, but in this case you will probably need to execute the gpupdate command to apply the change
×
×
  • Create New...