Help with Powershell to vbscript

Copper Contributor

We are in the process of changing our backup software over to another client. In order for us to do this we need to make some changes to the user profile for chrome browser to enable SSO to work with this software.

 

We can get this to work with a powershell script provided but unable to run powershell on machines due to our security department not wanting to allow us to run powershell scripts on machines. We are able to Run batch files or VB scripts. 

 

Is there anything out there to convert a powershell to vbscript or be able to convert the power shell script provided for us? Weve searched and havent been able to come up with a solid solution and running out of time until our deadline approaches.

 

Thanks for your help!

 

# set these first #
# the path to the user's chrome preferences should be included under "Set Variable" after the profile value #

$FormatEnumerationLimit=-1
$pathstart = $env:USERPROFILE
set-variable -name path -value $pathstart"\AppData\Local\Google\Chrome\User Data\Default\Preferences"
set-variable -name Brand -value ddpcb
set-variable -name outpath -value $pathstart"\AppData\Local\Google\Chrome\User Data\Default\Preferences2"

# Now to the fun parts
$preffile = [IO.File]::ReadAllText($path)
$info = ConvertFrom-Json -InputObject $preffile
$info.protocol_handler.excluded_schemes | Add-Member -type NoteProperty -Name $Brand -Value False -Force
$returnfile = ConvertTo-Json $info -Compress
Out-File -FilePath $outpath -Force -InputObject $returnfile

1 Reply

Try this - put the script into a file  fixit.ps1 and then try this from cmd.exe:
powershell -executionpolicy bypass -file fixit.ps1