-
Posts
80 -
Joined
-
Last visited
Recent Profile Visitors
540 profile views
Darien's Achievements

Wayfarer (2/7)
0
Reputation
-
How to always compile AutoIt scripts as x86?
Darien replied to Darien's topic in AutoIt General Help and Support
I won't always remember. -
SOLVE-SMART reacted to a post in a topic: Script to map Google Drive using API
-
Script to map Google Drive using API
Darien replied to Darien's topic in AutoIt General Help and Support
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. -
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?
-
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
-
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.
-
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
-
_Security__LookupAccountSid not working on windows 10?
Darien replied to kosamja's topic in AutoIt General Help and Support
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. -
Run Powershell command line from AutoIt
Darien replied to Jibberish's topic in AutoIt General Help and Support
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"")- 2 replies
-
- powershell
- encoding
-
(and 1 more)
Tagged with:
-
Script Does Not Run as Administrator from the Network
Darien replied to Darien's topic in AutoIt General Help and Support
In my language (Portuguese) the account name is "administrador". I forgot to translate into English ("administrator") when I copied the script for this topic. -
Script Does Not Run as Administrator from the Network
Darien replied to Darien's topic in AutoIt General Help and Support
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 -
Script Does Not Run as Administrator from the Network
Darien replied to Darien's topic in AutoIt General Help and Support
This script is to be run by regular users to install certain programs that require administrator privileges. -
Script Does Not Run as Administrator from the Network
Darien replied to Darien's topic in AutoIt General Help and Support
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).