1

I have a batch file that executes these commands:

set repodir=D:\Folder
cd /d %repodir%
call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86_amd64
tf undo * /recursive /noprompt
tf get

I want to achieve same functionality from shell script. I am able to change the directory path to wherever code is present

Problems:

  1. command call is not found - read that I need to use . operator in shell script. Tried this but not working. Error is "@echo command not found" in vcvarsall.bat ( the first line in that file is @echo off )

    . "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86_amd64

  2. Since calling batch file is failing in step 2, command tf is not found

    tf undo * /recursive /noprompt tf get

Environment: I am trying to run the shell script using cygwin on Windows Server 2008

1
  • @JonTofte-Hansen space should be there. But thats not the problem. I get error at line 1 ( in vccarsall.bat ) where @echo off is there Commented Nov 6, 2015 at 10:39

1 Answer 1

1
  1. Remove the 'call' because that is for calling one bat file from another.
  2. Specify the full path for tf.exe. Of course that will vary depending on the version of TFS you have installed.
Sign up to request clarification or add additional context in comments.

1 Comment

RGuggisberg is correct. You should have the following in the batch file: set repodir=D:\Folder cd /d %repodir% "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86_amd64 "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf.exe undo * /recursive /noprompt" "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf.exe get /all"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.