Created
May 20, 2021 08:00
-
-
Save lansalot/3001c6737e534e5075e7e4ba844fd48e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$servers = import-csv .\unquotedservers.txt -Delimiter "!" # what was I doing here? meh... | |
ForEach ($Server in $Servers) { | |
Write-Progress "Checking $($Server.Server) and `"$($server.servicename)`"" | |
$st = sc.exe \\$($server.Server) qc "$($server.servicename)" | select-string BINARY_PATH | |
$exe = $st.line.substring($st.line.indexof(":") + 2 ,$st.line.indexof(".exe") - $st.line.indexof(":") + 2) | |
$st | |
$fixed = "`"`\`"$exe\`"`"" | |
"sc.exe \\$($server.server) config `"$($server.servicename)`" binpath= $fixed" | |
"" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment