Jump to content

Darien

Active Members
  • Posts

    80
  • Joined

  • Last visited

Recent Profile Visitors

540 profile views

Darien's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. Olá, Is there any way to ensure that the "Compile x86 version" option is always checked in the compilation window without having to reinstall AutoIt or SciTE?
  2. Thanks. For me the scrollbar only appeared when I used the $WS_VSCROLL parameter (which is not in the AutoIt help).
  3. Hello, When I open a drop-down box, a maximum of 30 items are displayed on the screen at once (and there is space on the screen to display more). To show more items, I have to go down with the arrow. Is there any way to show more than 30 items or to display a scroll bar on the right?
  4. I don't have the slightest idea how to do this. I thought someone might already have this ready. If you don't have it, let it go.
  5. Hello, Does anyone know how to create a script using API that allows you to log in to google drive, map the drive and log out?
  6. I want to capture the out of the process to know the result of a command DOS. For example: If StringInStr ( Executa_dos_4 ( "wmic qfe get hotfixid" , "" , "" ) , "4493441" ) Then If StringInStr ( Executa_dos_4 ( "devcon status @" & $ID , $pasta_devcon , "" ) , "Device is disabled" ) Then If StringInStr ( Executa_dos_4 ( "sc query spooler" , "" , "" ) , "RUNNING" ) Then
  7. I did not find Code Box. I put it on the body of the topic. This is just a generic example to demonstrate the lock, I use the "execute_dos_4" function for various things.
  8. Good afternoon, I realized that when a script performs a lot of processing, it hangs, such as the below program. Can you solve this? #include <Array.au3> Break (0) Local $matriz_aplicativos [6] = [ "*zunemusic*"           _    ; Groove Música                                 , "*solitairecollection*" _    ; Microsoft Solitaire Collection                                 , "*zunevideo*"           _    ; Filmes e TV                                 , "*xbox*"                   _    ; Xbox Console Companion e Xbox Game Bar                                 , "*officehub*"           _    ; Office                                 , "*skypeapp*"               ] ; Skype _ArrayAdd ( $matriz_aplicativos , "*HPAudioControl*"       ) ; HP Audio Control _ArrayAdd ( $matriz_aplicativos , "*HPSystemInformation*" ) ; HP System Information For $indice_aplicativo = 0 To UBound ( $matriz_aplicativos ) - 1     For $num = 1 To 10         Executa_dos_4 ( "powershell.exe -command ""Get-AppXPackage " & $matriz_aplicativos [$indice_aplicativo] _                       & " | Remove-AppXPackage""" , "" , "" )     Next Next MsgBox(262144,"","End") ; ============================================ ; Função que executa um comando DOS - versão 4 ; ============================================ Func Executa_dos_4 ( $comando , $workdir , $funcao )     $pid        = Run ( @ComSpec & " /c " & $comando , $workdir , @SW_HIDE , $STDERR_CHILD + $STDOUT_CHILD )     $resultado = ""     $erro       = ""     While 1         If $funcao <> "" Then Call ( $funcao )         $resultado = $resultado & StdoutRead ( $pid )         $erro        = $erro        & StderrRead ( $pid )         If @error Then             StdioClose ( $pid )             Return        ( _OemToStr ( $resultado & "|" & $erro ) )         EndIf     WEnd EndFunc ; ========================================================= ; Função que corrige um texto com caracteres fora do padrão ; ========================================================= Func _OemToStr ( $sOEM , $iCodepage = Default )     If $iCodepage = Default Then         $iCodepage = Int ( RegRead ( "HKLM\SYSTEM\CurrentControlSet\Control\Nls\Codepage" , "OEMCP" ) )     EndIf     Local              $tText   = DllStructCreate ( "byte[" & StringLen ( $sOEM ) & "]" )     DllStructSetData ( $tText , 1 , $sOEM )     Local              $aResult = DllCall ( "kernel32.dll" , "int" , "MultiByteToWideChar" , "uint" _                                         , $iCodepage , "dword" , 0 , "struct*" , $tText , "int" _                                         , StringLen ( $sOEM ) , "ptr" , 0 , "int" , 0 ) , _                      $tWstr   = DllStructCreate ("wchar[" & $aResult [0] & "]" )                      $aResult = DllCall ( "kernel32.dll" , "int" , "MultiByteToWideChar" , "uint" _                                         , $iCodepage , "dword" , 0 , "struct*" , $tText , "int" _                                         , StringLen ( $sOEM ), "struct*" , $tWstr , "int" , $aResult [0] )     Return              DllStructGetData ( $tWstr , 1 ) EndFunc
  9. I found that it only works with local accounts. It doesn't work with Samba accounts (it used to work). It may work with Active Directory accounts, but I don't have it here to test.
  10. I had to use the quotes as follows, otherwise the "Remove-AppxPackage" parameter is not recognized: RunWait("C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command Get-AppxPackage ""*zunemusic* | Remove-AppxPackage"")
  11. In my language (Portuguese) the account name is "administrador". I forgot to translate into English ("administrator") when I copied the script for this topic.
  12. With the last script I sent (below), it does not matter, because the script copies itself to the HD and then runs from there: If IsAdmin () Then MsgBox (0,"","running with administrator right") Else MsgBox (0,"","running without administrator right") FileCopy ( @ScriptFullPath , "C:\TEMP\" & @ScriptName , 9 ) RunAs ( "administrador" , @ComputerName , $admin_password , 0 , @ScriptName , "C:\TEMP\" , @SW_HIDE ) EndIf
  13. This script is to be run by regular users to install certain programs that require administrator privileges.
  14. Did you mean to right click on the script and choose to run as administrator? In this case, it also does not display the "OK" message. If I hold down the SHIFT key, right-click the script, choose to run as a different user and authenticate with the user "administrator", it says that the system can not find the specified drive (since a local account does not see a drive network). To discard the possibility of not running the script as administrator because it does not see the network drive, I changed the script to: If IsAdmin () Then MsgBox (0,"","running with administrator right") Else MsgBox (0,"","running without administrator right") FileCopy ( @ScriptFullPath , "C:\TEMP\" & @ScriptName , 9 ) RunAs ( "administrador" , @ComputerName , $admin_password , 0 , @ScriptName , "C:\TEMP\" , @SW_HIDE ) EndIf But the results are the same (only shows the message "running without administrator right"). Already if I run the script from "C: \ TEMP", it displays both "running without administrator right" and "running with administrator right" messages).
×
×
  • Create New...