none
Server Name test in Cmd file?

    Question

  • Hello,

    I have the following command file:

    set sql_dir=C:\Progra~1\Tivoli\TSM\TDPExchange
    for /f "tokens=1-4" %%i in ('date /t') do set today=%%i
    call :backup
    goto :eof
    :backup
    if %today%==Mon call :incremental
    if %today%==Tue call :incremental
    if %today%==Wed call :full
    if %today%==Thu call :incremental
    if %today%==Fri call :incremental
    if %today%==Sat call :incremental
    if %today%==Sun call :full
    set today=
    goto :eof
    :incremental
    %sql_dir%\tdpexcc backup * diff /tsmoptfile=%sql_dir%\dsm.opt /logfile=%sql_dir%\excsch.log >> %sql_dir%\excdiff.log
    goto :eof
    :full
    %sql_dir%\tdpexcc backup * full /tsmoptfile=%sql_dir%\dsm.opt /logfile=%sql_dir%\excsch.log >> %sql_dir%\excfull.log
    goto :eof
    

    I would like to add a test on the server name what is the command line to do this?

    Thanks,

    DOm


    System Center Operations Manager 2007 / System Center Configuration Manager 2007 R2 / Forefront Client Security / Forefront Identity Manager

    Tuesday, May 21, 2013 5:16 PM

Answers

  • if %COMPUTERNAME%==<<SERVERNAME>> works perfectly

    Thnaks,

    DOm


    System Center Operations Manager 2007 / System Center Configuration Manager 2007 R2 / Forefront Client Security / Forefront Identity Manager

    • Marked as answer by Felyjos Tuesday, May 21, 2013 7:11 PM
    Tuesday, May 21, 2013 7:11 PM