# Batch File Won't Exit



## mertes (Dec 28, 2010)

I have searched for this and found some answers to a similar question on this site, but it has not helped me. I am trying to run a very simple batch file on startup using Windows XP. 

I am very new to this but I am trying to open SnagIt in hidden view. When I type the command below into cmd, it works fine. When I paste the exact same command into batch file and place it in the startup folder, it runs on startup, but hangs and won't close (See image 1). The program I am trying to call opens just fine though. 

The batch file contatins the following:
----------------------------------------
"C:\Program Files\TechSmith\SnagIt 6\snagit32.exe" /h
----------------------------------------

It seems like something is hanging because I can't type in the CMD window anymore and a new prompt doesn't appear. I have tried appending "exit" on the next line of the batch file but the results are the same. I've also tried 

---------------------------------------
"C:\Program Files\TechSmith\SnagIt 6\snagit32.exe" /h
cls
exit
---------------------------------------
start
"C:\Program Files\TechSmith\SnagIt 6\snagit32.exe" /h
exit /b
---------------------------------------

It must be something simple I'm doing completely wrong.


----------



## ve03vsx (Feb 11, 2011)

Hi,
I'm new here to and I was just wondering what the slash h does /h at the end????


----------



## mertes (Dec 28, 2010)

the /h switch hides the window when the program starts


----------



## Squashman (Apr 4, 2003)

I know nothing about running snagit from the cmd line but you should in theory be able to start any program from the cmd line.

If you are using the start cmd then you need to use the correct syntax. The start cmd assumes the first set of quotes is the Title of the screen.


```
start "" ""C:\Program Files\TechSmith\SnagIt 6\snagit32.exe" /h
```


----------



## Frank4d (Sep 10, 2006)

mertes said:


> It must be something simple I'm doing completely wrong.


You need the *start* command and path to snagit on the same line, as posted by Squashman.


----------



## mertes (Dec 28, 2010)

Thank you both, I'll try that. So if my batch file contains only this:
--------------------------------
"C:\Program Files\TechSmith\SnagIt 6\snagit32.exe" /h
--------------------------------
and it runs and closes without error when i double click it, is there a reason the same batch file would cause the command line window to hang when running at startup?

I've tried this on three computers. On all three it freezes on startup but runs correctly when run manually.


----------

