TheReasonIFail Posted August 29, 2008 Share Posted August 29, 2008 Hi,I'm hoping to create a batch file that will ask me to input certain information and edit the sysprep.inf file accordingly.For example, I'd like for the batch file to ask me to enter a workstation name and once I do so, it will edit sysprep.inf adding that workstation name.So on and so forth...I'd like to do this for a few things, but if you can point me in the right direction I think I should be able to figure it out on my own.Thanks. Link to comment Share on other sites More sharing options...
jaclaz Posted August 29, 2008 Share Posted August 29, 2008 .inf files have the same "structure" as old .ini files.This is a good start point:http://www.robvanderwoude.com/batchtools.htmlThough it is possible to use a "pure" batch solution, here is an example for reading .ini files from batch:http://www.robvanderwoude.com/batexamples_r.html#Rthe use of the program from Horst Schaeffer or a similar one is much easier.jaclaz Link to comment Share on other sites More sharing options...
TheReasonIFail Posted September 3, 2008 Author Share Posted September 3, 2008 The thing is, when I run this file I want it to prompt me to enter this information and then it will edit the sysprep.inf file with the information I input. Link to comment Share on other sites More sharing options...
jaclaz Posted September 3, 2008 Share Posted September 3, 2008 The thing is, when I run this file I want it to prompt me to enter this information and then it will edit the sysprep.inf file with the information I input.Yep, I understand that, what I am missing is what are you asking for:Q: A pointer in the right direction? A: GivenQ: Which utility to use from batch to edit a .inf file?A: GivenQ: How to edit a .inf file ONLY with a batch?A: Writing your own batch to read and write .inf files, a (read only) example given.Q: How can I give input to a batch?A:ECHO We need some input from you:SET /P TheInput= Please type Workstation nameCLSECHO Thanks, you typed "%TheInput%"A much more complete answer is, again, on the given site:http://www.robvanderwoude.com/batchfiles.htmlUser input, or: "How To Make Your Batch Files Interactive"http://www.robvanderwoude.com/userinput.htmlWindows 2000/XPIn Windows 2000, user input can be obtained quite easily by using SET /PSET /P variable=[promptString]This command will display an optional promptString where the user can type in a string and press Enter. The typed string will then be stored in the specified environment variable variable.Q: Can you teach me the batch file commands/language?A: No, sorry, but it's out of the scope of the thread/board, there are a number of tutorials and online documentation, including the Rob van der Woude site I already pointed you to, "choking full" of examplesQ: Will you write the batch for me?A: Hmmm, no, I will gladly try and help you with snippets like the above one, or try and help you for anything that is not really basic (if I can ).Don't take it the wrong way , but to me this thread appears a bit like:Q: I'm hoping to drive a racing car, what should I do?A: You will need to take a driving course and obtain a racing license, here is a link to a good school:...............................Q: Okay, but actually I want to start the engine, where is the ignition key?A: jaclaz Link to comment Share on other sites More sharing options...
TheReasonIFail Posted September 4, 2008 Author Share Posted September 4, 2008 (edited) Wow, I looked at the links you sent me and totally missed that!Thanks! Edited September 4, 2008 by TheReasonIFail Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now