Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8076365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:14:47+00:00 2026-06-05T15:14:47+00:00

OK basicly what I am trying to do is make a script that will

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:14:48+00:00Added an answer on June 5, 2026 at 3:14 pm

    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.

    set current_shockwave_version=1
    set current_flash_version=1
    

    With the new values.
    The easiest way is to move the two lines into a config.bat file, then you can use something like

    call config.bat
    echo current_flash_version = %current_flash_version%
    
    :UpdateValues
    FOR /F "tokens=2*" %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\FlashPlayer" /v CurrentVersion ') DO SET Installed_Flash_Version=%%B
    FOR /F "tokens=2*" %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Shockwave 11\currentupdateversion" ') DO SET Installed_Shockwave_Version=%%B
    (
      echo set current_shockwave_version=%Installed_Shockwave_Version%
      echo set current_flash_version=%Installed_Flash_Version%
    ) > config.bat
    

    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.

    @echo off
    call :setValues
    echo current_flash_version = %current_flash_version%
    call :UpdateValues
    echo new current_flash_version = %current_flash_version%
    exit /b
    
    :UpdateValues
    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
    REM ** Copy and modify the own batch
    findstr /v /r "##DB##$" "%~f0" > "%~f0.tmp"
    (
      (echo set "current_shockwave_version=%Installed_Shockwave_Version%" ^& REM ##DB##)
      (echo set "current_flash_version=%Installed_Flash_Version%" ^& REM ##DB##)
    ) >> "%~f0.tmp"
    (
      copy "%~f0.tmp" "%~f0"
      del "%~f0.tmp"
    )
    call :setValues
    exit /b
    
    :setValues
    set "current_shockwave_version=1" & REM ##DB##
    set "current_flash_version=1" & REM ##DB##
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So basicly what I'm trying to accomplish is that foreach row in mysql query
Basicly i'm trying to create image cropping script, and it's almost done, here is
EDIT following Ben's answer I'm trying to make something that should be very easy
basicly, I'm trying to show the result of a listview (created with QSLite)but in
I'm trying to create a pl/sql block that uses references. Basicly, this is what
I'm new to java and am trying to write a simple program that basicly
I'm trying to build some GANT script prior to my Grails Plugin. Basicly, i
Ok, so I basicly have this list. What I'm trying to do is just
I have a session class that basicly just sets and retrieves session variables, the
Iam trying to make my Activity List more effective. I have an Activity List

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.