Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $filePath = "C:\ProgramData\Danaher_Dental\DEXIS.ini"
  2.  
  3.     ((Get-Content -Path $filePath -Raw) -replace 'DataPath=', 'D4=') | Set-Content -Path $filePath
  4.    
  5.     (Get-Content $filePath) |
  6.         ForEach-Object{
  7.             $_
  8.             if ($_ -match "D4=.*"){
  9.                
  10.                 "DataPath=$newPath"
  11.             }
  12.         } | Set-Content $filePath
  13.  
  14.      ((Get-Content -Path $filePath -Raw) -replace 'D4=.*', '') | Set-Content -Path $filePath
  15.  
  16.     Write-Host $newPath " has been set as the new path."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement