Results 1 to 3 of 3

Thread: passing a variable to reg add through batch script

  1. #1
    Administrator James's Avatar
    Join Date
    May 2010
    Location
    on the intraweb
    Posts
    2,982

    Default passing a variable to reg add through batch script

    Running into a silly issue with a batch script. Was wondering if any of you can help me out. I posted it on here: https://stackoverflow.com/questions/...-in-a-variable

    Let me know if you need clarification. I can't seem to figure out how to pass that variable.. errr :S

  2. #2

    Default

    Sent you a PM that might help.
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  3. #3
    Administrator James's Avatar
    Join Date
    May 2010
    Location
    on the intraweb
    Posts
    2,982

    Default

    Thanks. So I know how to pass variables like in your example, but the issue was that the initial command I was using reg query for would print out multiple lines, but only display the Results like so "End of search: 1 match(es) found." instead of the key that I actually want. The guy in that thread was able to assist me and from there I was able to then pass the variable to reg add without any issues.


    for /f "tokens=*" %%A in ('reg query HKLM\SYSTEM\ControlSet001\Services /K /F bomgar-scc /S^| find /V "End of search"') do (
    Set "BomgarService=%%A"
    )

    echo %BomgarService%


    The " find /V "End of search"" was what I didn't know how to do, but it looks like it filters out that line so then it displays the key which is exactly what I needed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •