Improve company productivity with a Business Account.Sign Up


Install program from batch file or alter shortcut properties

Posted on 2001-06-29
Medium Priority
Last Modified: 2008-02-26
Hello All,

First off, I'll admit I suck at DOS.  I'm really not sure of the capabilites of DOS.  Is it possible to write a batch file that will:

A.  Install another program.  If I were to manually install it, I would click the *.exe file then go through and hit the "Next" button at each prompt, then finally hit the "Finish" button.

B.  Alter the properties of a shortcut on the desktop.  I want to change the "Start in:" field of the shortcut.

Any thoughts would be appreciated or any documentation you could point me towards.
Question by:diamond1
LVL 50

Expert Comment

ID: 6239532
A Possibly not.  You would have to know the exact sequence of steps involved in the installation.  If there was no deviation you could then possibly use a keyboard stuffer to supply input strokes to the executeable to doi ti.  

I would personally use a Windows Scripting Language to do it in any case such as WinCmd written by Douglas Boling and available on ZDNet.

B  I understand that this is possible but someone else will have to supply the information.
LVL 24

Expert Comment

ID: 6239895
A1) Normally a good installer has its own way of collecting the proper keystrokes and stuffing them in a file such as .ini or .cfg or .ans. This may be called an answer file. Check out yours. Try a /? for help on options.

A2) try appending (randomly) some silencing option, like the /s switch. May be /n for noninteractive mode. Might work even if not documented. Or might get error telling you what valid options are, so you are in business again.

A3) try appending <filename using left angle bracket to indicate an input file. Stuff commands in there, a new file.

A4) see dbrunton. Most often, the program will behave differently from one machine to another, as it runs a discovery process looking for old code or programs it knows it is incompatible with, perhaps bringing up a question on one machine "UpGrade? Or keep old .dll?".

If the program does not use files in \windows, if it does not update registry, your odds of success are better

B) This is too too tricky. Especially for novice or naive like me. But .reg files with commands is one way to do it, once you have fixated exactly what you want to change, providing common platforms. Caution, messing with registry can and will cause problems. What if run on machine that is not exactly identical in every way?

OTOH, for own machine, with physical access, hit shortcut w/ right mouse click, change properties to heart's content. Including the 'Start In'. Why use dos if not have to?

Accepted Solution

Hypermaniak earned 400 total points
ID: 6347446
Hello, diamond1.

I think I may have a few solutions :O)

A. Depending on the proggy, I think there is a way to "menu drive" a DOS executable in a batch file.  Note that it depends on the program.  You can test to be sure (on most proggys) that this is possible by entering the name of the program followed by either the syntatxes /? or /help or /h, etc.  Some programs do have syntaxes that allow you to skip the menu driven systems altogether (usually for advanced users). e.g. C:\>soundone.exe /?
Usually if there are syntaxes to be allowed by the proggy, then using a help syntax will more often than not, provide a list of the syntaxes and instructions on how to use them.  Then, all you gotta do is incorporate it into the batch file (which is almost like typing in DOS, except everything in a single command and in a sequence events.

B. This is simple (if I understand your question correctly).  Just right-click the desktop shortcut icon and and under properties, insert your path in the specified field.

Author Comment

ID: 6348322
Your answer to 'A' is great!  Thank you!

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
The video will let you know the exact process to import OST/PST files to the cloud based Office 365 mailboxes. Using Kernel Import PST to Office 365 tool, one can quickly import numerous OST/PST files to Office 365. Besides this, the tool also comes…
From store locators to asset tracking and route optimization, learn how leading companies are using Google Maps APIs throughout the customer journey to increase checkout conversions, boost user engagement, and optimize order fulfillment. Powered …

584 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question