1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Resolved .bat code from an XP system not executing

Discussion in 'Windows 7' started by Sduibek, 2011/02/11.

  1. 2011/02/11
    Sduibek

    Sduibek Inactive Thread Starter

    Joined:
    2008/09/10
    Messages:
    74
    Likes Received:
    0
    I have users trying to run the following on Windows 7 x64 and it's giving them an error (working on locating the exact message now). I don't know which commands are unsupported by Windows 7... if anyone has any ideas please let me know. Thank you very much!

    Code:
    :mapply
    @echo Applying patch to master.dat...
    @patch\tpatch.exe master.dat patch\master.pat
    @if %ERRORLEVEL%. == 0. goto msuccess
    @echo ...failed.
    @goto capply
    :msuccess
    @echo ...success.
    
    :capply
    @echo Applying patch to critter.dat...
    @patch\tpatch.exe critter.dat patch\critter.pat
    @if %ERRORLEVEL%. == 0. goto csuccess
    @echo ...failed.
    @goto end
    :csuccess
    @echo ...success.
    
    :end
    
    
    
    @set refreshname=fo1_screen_refresh_int
    @if exist %refreshname%.exe goto execute
    @set refreshname=fo1_screen_refresh
    @if exist %refreshname%.exe goto execute
    
    @echo Error: Fo1_screen_refresh not found.
    @pause
    @goto end
    
    :execute
    @start /MIN %refreshname%.exe
    @falloutw.exe
    @taskkill /IM %refreshname%.exe
    
    :end
    
    
     
  2. 2011/02/12
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Command-line Reference

    Updated: October 25, 2010

    Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista
     

  3. to hide this advert.

  4. 2011/02/26
    Sduibek

    Sduibek Inactive Thread Starter

    Joined:
    2008/09/10
    Messages:
    74
    Likes Received:
    0
    Thank you.
     
  5. 2011/03/09
    Sduibek

    Sduibek Inactive Thread Starter

    Joined:
    2008/09/10
    Messages:
    74
    Likes Received:
    0
    I have another similar question... I am trying to replace a specific string of text within a text file, which I should be able to do with the FOR command, but all I keep getting is an error saying the expression is unexpected.

    Goal is to replace "free_space=20480" (without quotes) with "free_space=0" (without quotes).

    Code:
    for {%%}A in (falloutcfg.tmp) do (
    --> "{%%}A was unexpected at this time. "

    I have tried what feels like dozens of variations on the "%%a" portion of the command, and it always just comes back with unexpected.


    EDIT: Meh. Just downloaded a windows version of sed and used that instead. Much easier. :sigh:
     
    Last edited: 2011/03/09

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.