Run program in Minimized Mode with BATCH file

I want to run a program with a BATCH file and have it start in Minimized mode. This is what is in the BATCH file right now.

Call "C:\Documents and Settings\USER\My Documents\Programs\Shortcut name.lnk"

I am using Call instead of Run or Start because when I use these it fails. My guess is because I have spaces in the path.

Any help is appreciated.

calbackupAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan_KemptCommented:
Why are you calling a shortcut and not the file the shortcut leads to? Anyways, if I understand correctly you should look up CMDOW (Commandline Window Utility) which allows you to hide windows that you execute from bash, remove them from the toolbar, among many other neat things.
0
MshineCommented:
Try using a "_" between Shortcut_name.lnk

Try using START instead of call...??? I am not huge on DOS but here is a link
for help.. and try the commands /MIN  (for minimized) or /S  (for Silient hidden)

Like this:
Start /Min "C:\Documents and Settings\USER\My Documents\Programs\Shortcut name.lnk"

http://www.computerhope.com/starthlp.htm
0
MshineCommented:
Duh... Changing the space to a _ would screw up your reference.. scratch that note.
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

drbayerCommented:
Instead of trying to run a link you need to run the program directly.  The "start" command provides the functionality you're looking for.  If your path has spaces, then specify the path with the /D flag and the path in quotes.  Be careful to put /MIN before the command itself, as otherwise it might be interpreted as a parameter for the command rather than as a parameter for START.

Example:  to start Internet Explorer minimized
start /D"C:\Program Files\Internet Explorer" /MIN /B iexplore.exe

Notice there is no space between /D and the path, but there is between /B and the command.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
LordWolfyCommented:
You could also use the START command with the DOS filenames and the MIN option to alleviate the problem of spaces.  And if possible run the program instead of the shortcut.  

The general rule for shortening filenames is that for anything longer than 8 chars or anything with spaces, you take the first 6 (or less if there arent that many) followed by a ~ and then a number.  This is usually 1 but if anything else matches those first 6 characters (very rarely the case) the number is taken according to alphabetical order.

Here is an example based on your code:
start c:\docume~1\user\mydocu~1\programs\program /MIN

Open in new window

0
LordWolfyCommented:
Sorry - thats chronological order not alphabetical
0
calbackupAuthor Commented:
Thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.