Posts by João Mac-Cormick • 81 points
11 posts
-
0
votes1
answer59
viewsA: Batch Script to Restart Anydesk Service
Testing the variable value if /i not "%CID%" == "online" "C:\Program Files (x86)\AnyDesk\AnyDesk.exe" --restart-service or if /i "%CID%" == "offline" "C:\Program Files (x86)\AnyDesk\AnyDesk.exe"…
batchanswered João Mac-Cormick 81 -
0
votes1
answer81
viewsA: Test a port and capture a batch test response
You can use "powershell", which comes in the operating system. powershell.exe -executionpolicy bypass -command " & { $Global:ProgressPreference = 'SilentlyContinue' ; $Resposta =…
-
0
votes1
answer36
viewsA: Change another user’s records with powershell credential
You did not put the command code line Set-Item. The parameter Credential is used to execute a command as if it were in another account. You could only access the branch HKEY_CURRENT_USER if you knew…
powershellanswered João Mac-Cormick 81 -
1
votes1
answer109
viewsA: Filter AD User - Powershell/CSV
I rewrote excerpt from the code $Base = 'OU=BHZ,OU=MG,DC=elv,DC=intranet' Import-CSV $Users -Header 'UserPrincipalName' | Foreach-Object -Process { linha 1 Get-ADUser -Filter "UserPrincipalName…
-
0
votes1
answer289
viewsA: Remove duplicates based on one column value
Only with macro, programming VBA. In Libreoffice Calc, without using macro, it is possible to make a filter for a line, and not generate all lines. It would be generated one line at a time. The…
-
0
votes3
answers262
viewsA: Batch programming
In powershell is very simple. $Entrada = 'C:\entrada.txt' $Saída = 'C:\saída.txt' Get-Content -LiteralPath $Entrada | Group-Object | Select-Object -Property @{ Label = 'Coluna' Expression = {…
-
1
votes2
answers1092
viewsA: I can’t sync my windows clock
The early versions of windows 10 did not work properly synchronizing the time (NTP client service). I went down at the time, 2016, it was just headache. I was forced to wear "nettime". The latest…
-
1
votes1
answer205
viewsA: Script/Routine to run program
Tested in powershell 5.1, windows 10. Add-Type @' using System; using System.Diagnostics; using System.Runtime.InteropServices; namespace PInvoke.Win32 { public static class UserInput {…
-
0
votes1
answer345
viewsA: IF to set default printer via batch
You cannot compare piece of text to an "IF" clause in the DOS, so it will never work. What you want to do is check if a particular text pattern exists in the output of a command. In DOS, the most…
-
1
votes1
answer2444
viewsA: List installed print server printers from a remote station
In fact, what you do is you map a network printer to the user profile. This is not really an installation. We call this capturing the printer queue provided on server. What you want is to know which…
-
1
votes2
answers226
viewsA: Powershell file output. CSV after Foreach
Warning: Tests performed in windows 10 with powershell 5.1. Warning: "Write-Host" does not redirect to file but to console. Tip: The use of the "Try" clause should be avoided because it affects the…