Jump to content

Batch file to edit sysprep.inf


Recommended Posts

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


.inf files have the same "structure" as old .ini files.

This is a good start point:

http://www.robvanderwoude.com/batchtools.html

Though 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#R

the use of the program from Horst Schaeffer or a similar one is much easier.

jaclaz

Link to comment
Share on other sites

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: Given

Q: Which utility to use from batch to edit a .inf file?

A: Given

Q: 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 name
CLS
ECHO Thanks, you typed "%TheInput%"

A much more complete answer is, again, on the given site:

http://www.robvanderwoude.com/batchfiles.html

User input, or: "How To Make Your Batch Files Interactive"

http://www.robvanderwoude.com/userinput.html

Windows 2000/XP

In Windows 2000, user input can be obtained quite easily by using SET /P

SET /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 examples

Q: 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: :w00t:

jaclaz

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...