locked
Batch file help RRS feed

  • Question

  • I used to do a lot of batch file magic and have started a new job and trying to get back into it.   I have this batch file that is not working and would like some assistance.  

    SWVerinfo.bat

    @echo off
    setlocal
    cls
    wmic product get name, version /Format:csv > c:\sw.raw
    type c:\sw.raw > c:\sw.txt
    for /f "tokens=1-3 delims=," %%a in ("c:\sw.txt") do (
    if %%a EQU "" goto again
    echo %COMPUTERNAME% %%c >> \SWver\%%b.txt
    :again
    )
    endlocal

    right after for loop I get the error ") was unexpected at this time."   Any ideas?

    THanks.

    ITlongtime.

    • Moved by Just Karl Monday, August 11, 2014 10:08 PM Off-Topic
    Monday, May 20, 2013 7:22 PM

Answers

All replies

  • U could have given me a forum name...........

    Monday, May 20, 2013 8:25 PM
  • Hello,

    The Windows Desktop Perfmon and Diagnostic tools forum is to discuss performance monitor (perfmon), resource monitor (resmon), and task manager, focusing on HOW-TO, Errors/Problems, and usage scenarios.

    Since your post is off-topic, I am moving it to the off topic forum.

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

    Monday, August 11, 2014 10:07 PM
  • Hello,

    This should have been asked in The Official Scripting Guys Forum!

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

    • Proposed as answer by Just Karl Friday, August 15, 2014 2:02 PM
    • Marked as answer by Just Karl Friday, August 22, 2014 1:54 PM
    Monday, August 11, 2014 10:08 PM