MSFN Forum: Batch file to edit sysprep.inf - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Batch file to edit sysprep.inf or any other sort of file... Rate Topic: -----

#1 User is offline   TheReasonIFail 

  • Member
  • PipPip
  • Group: Members
  • Posts: 170
  • Joined: 08-April 07

Posted 29 August 2008 - 01:09 PM

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.


#2 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 9,084
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 29 August 2008 - 01:21 PM

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

This is a good start point:
http://www.robvander...batchtools.html

Though it is possible to use a "pure" batch solution, here is an example for reading .ini files from batch:
http://www.robvander...amples_r.html#R
the use of the program from Horst Schaeffer or a similar one is much easier.

jaclaz

#3 User is offline   TheReasonIFail 

  • Member
  • PipPip
  • Group: Members
  • Posts: 170
  • Joined: 08-April 07

Posted 03 September 2008 - 06:24 AM

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.

#4 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 9,084
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 03 September 2008 - 07:54 AM

View PostTheReasonIFail, on Sep 3 2008, 02:24 PM, said:

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.robvander...batchfiles.html

Quote

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

http://www.robvander.../userinput.html

Quote

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

#5 User is offline   TheReasonIFail 

  • Member
  • PipPip
  • Group: Members
  • Posts: 170
  • Joined: 08-April 07

Posted 04 September 2008 - 01:26 PM

Wow, I looked at the links you sent me and totally missed that!

Thanks!

This post has been edited by TheReasonIFail: 04 September 2008 - 01:27 PM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy