I am trying to create a batch file to add registry key.
its should run on both 32bit and 64 bit
there are 2 different registry keys for 32bit and 64bit.
so if it is 32-bit, it adds the 32-bit registry key and vice versa
Any ideas?
Thanks in advance
Windows BatchWindows OS
Last Comment
shyam pothini
8/22/2022 - Mon
Bill Prew
Give this a try.
for /f "skip=2 tokens=2-5 delims=," %%A in ('wmic os get osarchitecture^,version /format:csv') do set arch=%%Aif "%arch%" EQU "64-bit" ( rem do 64 bit logic here) else ( rem do 32 bit logic here)
I am confused.
I want to add commnd here
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
so how can I do that
Bill Prew
Based on your question I thought you knew how to add to the registry from batch, and were just looking for help differentiating between 32 and 64 bits.
If you want the exact registry commands, then I would need to know the key and value you want to add for both 32 and 64 bit.
Open in new window
»bp