Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am building an unattended install of windows 2000 for my network. However I want the "computer name" line (in unattend.txt) to be input by a user at a DOS prompt.
i have the file change.exe which works with the following command (located on a:)
a:\change [txt file name] "word in file" "new word in file"
eg:
change the word warren in file unattend.txt to monkeya:\change a:\prep\unattend.txt "warren" "monkey"
instead of monkey i am using %input% and the following line at the start of the script
FOR /F "tokens=*" %%A IN ('TYPE CON') DO SET INPUT=%%A
so all in all i have
@ECHO OFF
ECHO Type in the computer name.
ECHO Then Enter followed by F6 and then Enter again.FOR /F "tokens=*" %%A IN ('TYPE CON') DO SET INPUT=%%A
a:\change a:\prep\unattend.txt "warren" "%INPUT%"
this works in a cmd prompt in windows, but not at a dos prompt?? any ideas anyone

On DOS real mode, another method must be used. Read my FAQ:
However, the script on that URL only works on DOS/Win9x, not on NT systems. Here follows a solution that will work on all those systems:
:: ========================================================
:: Author: Leonardo Pignataro (secret_doom@hotmail.com)
:: ========================================================
:: Get user input and save on an environment variable.
:: ========================================================
:: The process is based on an assembler code, which should
:: make the compatiblity of this script very wide.
:: ========================================================
@echo off
echo `h}aXP5y`P]4nP_XW(F4(F6(F=(FF)FH(FL(Fe(FR0FTs*}`A?+,> %temp%.\input.com
echo fkOU):G*@Crv,*t$HU[rlf~#IubfRfXf(V#fj}fX4{PY$@fPfZsZ$:J=v$+C>> %temp%.\input.com
echo cCdO06s$W?DAj{?_@$H]44e.]tI:PAJr$W@U'j{?_@5oA07tbLV?=?sEY5lY>> %temp%.\input.com
echo zH]'=v\{+ZHu#>> %temp%.\input.com
echo Type input:
%temp%.\input.com > %temp%.\t1.bat:: Set variable name to save input below
call %temp%.\t1.bat MyInputfor %%? in (input.com t1.bat) do del %temp%.\%%?
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br__________________________________________________________________________________________

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |