OK basicly what I am trying to do is make a script that will update one variable with another.
I have already created all of the script so it pulls the new data from the registry and sets it, now i just need it to update an old variable.
Example script
set current_shockwave_version=1
set current_flash_version=1
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\FlashPlayer" /v CurrentVersion ') DO SET Installed_Flash_Version=%%B
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Shockwave 11\currentupdateversion" ') DO SET Installed_Shockwave_Version=%%B
Now i want to replace the value of current_shockwave_version & current_flash_version with the variables pulled from the registry. There will be a bunch of admins using this script and im trying to add a easy update function so they can just run this replace function on a computer that is fully updated.
It’s not very clear what result do you want, but I assume that you only want to read the registry value only once and update then the lines.
With the new values.
The easiest way is to move the two lines into a config.bat file, then you can use something like
EDIT: To the comment of replacing in the same batch file
It’s not a good idea to replace the values in the same batch file, as to do this you need to rewrite the batch while it’s running.
This can be done, but it’s tricky, especially if the length of the values will not be the same, the batch will work a bit unreliable.
You could solve it when you move the setting of the database values to the end of the file, but IMO it’s not the best idea to change the currently running batch.