Batch File or Visual Basic Script to Automate an install?
-
I need a batch file or VB Script to prompt user for input, then go to a specific server, copy a file to local machine, and then run and install that file based off the input from user. Any help is greatly apprreciated. Thanks
-
Answer:
A batch file is probably easier. You can prompt the user for input using the SET /P command, which creates an environment variable you specify to the input value.
asianedd... at Yahoo! Answers Visit the source
Other answers
Here is an example of how you might do this using VB Script... This takes some input, but doesn't do anything with it, if you wanted to user to enter a path to copy the file to then just replace the destination string in the file copy section with the variable name (PromptedInput), although if you do this you might need to validate the input incase the entered path is invalid. 'Prompt user for input Dim PromptedImput PromptedInput = inputbox("Please enter some data...") 'Show the users' input MsgBox PromptedInput 'Copy file Set fso = CreateObject("Scripting.FileSystemObject… fso.CopyFile "\\ServerPath\ShareName\FileName.exe", "c:\FileName.exe",TRUE 'Source path, followed by destination path 'Run Set wshShell = CreateObject("WScript.Shell") wshShell.Run "c:\FileName.exe"
Ben L
Related Q & A:
- How to skip the input in batch file?Best solution by Stack Overflow
- How to run an interactive batch file on windows from a service?Best solution by Stack Overflow
- What are the object-oriented features of Visual Basic.NET?Best solution by msdn.microsoft.com
- Can you program Graphics with Visual Basic?Best solution by Yahoo! Answers
- How to make a batch file copy itself?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.