DOS command in batch file


  1. Posts : 36
    windows7 64 bit
       #1

    DOS command in batch file


    Hey Guys,

    I have 3 DOS scripts that has to be merged into one .bat file . Basically i am trying to clean the temp files and getting the svn update and compiling and publishing the .net webapplication. below are my individual scripts.

    to clean the file :
    Code:
    @echo off
    
    echo *** Deleting ASP.NET temporary files (.NET 4.0)... ***
    
    echo Deleting 32-bit files...
    rmdir "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root" /Q /S
    
    echo Deleting 64-bit files...
    rmdir "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root" /Q /S
    
    pause
    to get svn update :

    Code:
    @echo off
    
    cls
    echo == Initiating system instance variables...
    echo. -- Setting the variables...
    
    :: Here you need to make some changes to suit your system.
    set SOURCE=D:\Nutrition_Build\Trunk
    set SVN=C:\Program Files\TortoiseSVN\bin
    
    :: Unless you want to modify the script, this is enough.
    
    echo. %SOURCE%
    echo. %SVN%
    echo. ++ Done setting variables.
    echo.
    echo == Updating source from SVN
    echo. -- Running update...
    "%SVN%\TortoiseProc.exe" /command:update /path:"%SOURCE%" /closeonend:2
    echo. ++ Done.
    
    echo. -- Cleaning up...
    set SOURCE=
    set SVN=
    echo. ++ Done.
    To compile and publish:
    Code:
    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Aspnet_compiler.exe -v / -p "E:\Sample\Myproject\Src" -u -f E:\BuildOutput\
    Please help me on merging this three scripts into one file.

    thanks.
      My Computer


  2. Posts : 6,285
    Windows 10 Pro X64
       #2

    Looks like you could simply merge them as I don't see any branching being done (no goto).
      My Computer


  3. Posts : 36
    windows7 64 bit
    Thread Starter
       #3

    Hey Ztruker,

    I did try that. but i am getting error on last script.
    '"c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Aspnet_compiler.exe -v / -p "E:\Sample\Myproject\Src" -u -f E:\BuildOutput\"' is not recognized as an internal or external command,
    if i copy and execute straightway on command prompt it's working

    Any suggestion please
      My Computer


  4. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #4

    Hi guys,

    Born2achieve, just as Ztruker notes, the scripts are very linear. So you should be able to merge the three parts into one by simply copy pasting each part one after the other into one batch file.


    Also, I notice the command displayed in the above post's error message is not the same as the last script listed in post 1.

    Code:
    "c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Aspnet_compiler.exe -v / -p "E:\Sample\Myproject\Src" -u -f E:\BuildOutput\"
    is not the same as
    Code:
    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Aspnet_compiler.exe -v / -p "E:\Sample\Myproject\Src" -u -f E:\BuildOutput\
    There is an extra pair of quotes in the former (effect of this is that the entire line is treated as a single path to a command; the supposed arguments are actually part of the path/command name).

    The ladder is correct.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 13:50.
Find Us