1

I wrote a short batch script (Windows 7) to bundle a Git repo and save a copy on a network drive:

@ECHO OFF
cd /D E:/mypath/myrepo.git
start "Window title" "C:\pathto\Git\git-cmd.exe" git bundle create X:/outpath/name.bundle --branches --tags

This works as expected, however, I would like the window to close when complete. I tried exit but the window just returns to the directory specified by cd, and remains open.

How can I close the window? (I've seen plenty of speculative answers in other posts, I'm asking how I can really/actually close the window in this case)

1 Answer 1

2

try with :

start "Window title" "C:\pathto\Git\git-cmd.exe" git bundle create X:/outpath/name.bundle --branches --tags ^&exit 

To exit the console of course you need exit command. To execute two commands on one line you ussally use ampersand . But in this case you want the exit as part of START command ,but not be executed after start so you escape the & with caret.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.