Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. "SET" Command Scope in Batch File

"SET" Command Scope in Batch File

Scheduled Pinned Locked Moved Windows API
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Skippums
    wrote on last edited by
    #1

    I would like to run the same batch file twice at about the same time. Both batch files create the same variables using the "SET" command. Is there any chance that one batch file will overwrite the value created in the other, or does the SET command declare only local variables? Thanks,

    Sounds like somebody's got a case of the Mondays -Jeff

    L 1 Reply Last reply
    0
    • S Skippums

      I would like to run the same batch file twice at about the same time. Both batch files create the same variables using the "SET" command. Is there any chance that one batch file will overwrite the value created in the other, or does the SET command declare only local variables? Thanks,

      Sounds like somebody's got a case of the Mondays -Jeff

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Skippums wrote:

      or does the SET command declare only local variables?

      Yes, SET creates environment variables but they only exist within the scope of the command that runs them. Thus your two batch files will inherit the environment variables of the parent process (Windows ???) but any new ones they create will not be seen by the other process.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups