[Solved] how to create ps1 file which takes input as json and based on parameters exceute batch file? [closed]

This is a Batch-file solution (posted here because this question have the batch-file tag) that IMO is simpler than any ps1 solution, but I am sure it run faster than the ps1 solution. @echo off setlocal EnableDelayedExpansion set “Version=” for /F “tokens=1,2 delims=:, ” %%a in (‘findstr “:” input.txt’) do ( set “%%a=%%~b” if defined … Read more

[Solved] How to add a yes/no response in a batch file

Insert these 3 lines after the line :CLEAN at line 66. set “reply=y” set /p “reply=Clean user profile for %USERREG%? [y|n]: ” if /i not “%reply%” == “y” goto :eof If you type y or just press enter which implies y, it continues the clean, else other input implies n which goes to end of … Read more

[Solved] Random alphanumeric

@echo off setlocal enableextensions enabledelayedexpansion rem Define alphabet set “alphabet=a b c d f g h i j k l m n p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9” rem Create an “array” with the elements of the alphabet set “size=0” … Read more

[Solved] batch file code to detect 32-bit vs 64-bit office not working [closed]

If you’re wanting to check the bitness, version and install location of Microsoft Office, you could give this script a test to see if it works for you any better: @Echo Off If Defined PROCESSOR_ARCHITEW6432 ( Start “” /D “%__CD__%” “%SystemRoot%\SysNative\cmd.exe” /C “%~f0″&Exit /B) Set /A “OSA=MWB=%PROCESSOR_ARCHITECTURE:~-2%” If %OSA%==86 Set “MWB=32” Set “MOB=”&Set “GUID=”&Set “REG=%__AppDir__%reg.exe” … Read more