Install program from batch file or alter shortcut properties

Posted on 2001-06-29
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 49

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 100 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (…
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…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

734 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