einstein1969 said:
Code:
:: You need download sysinternal contig (32bit) and copy in "windows\system32" folder
The following code will check whether "Contig.exe" and "Contig64.exe" exist in "System32". If they do not exist, "Contig.zip" will be downloaded, and the files will be extracted into "System32".
Code:
$Result1=Test-Path -Path "$env:homeDrive\Windows\System32\Contig.exe"
$Result2=Test-Path -Path "$env:homeDrive\Windows\System32\Contig64.exe"
If($Result1 -eq $True ` -and` $Result2 -eq $True){Write-host "Contig already exists."}else{
IWR -URI 'https://download.sysinternals.com/files/Contig.zip' -OutFile "$env:temp\Contig.zip"
Expand-Archive -Force "$env:temp\Contig.zip" "$env:homeDrive\Windows\System32\"
Remove-Item "$env:temp\Contig.zip"}
Pause

Administrative privileges are needed because the destination folder is "System32".
The PowerShell code can be converted into CMD code if need be.