DOS question

RU482

Lifer
Apr 9, 2000
12,689
3
81
I am using a program in DOS that programs the serial number into the BIOS of a computer I am working with (long story)

The computer I am working with only has a numeric keypad, no letters. Thus far I have been able to write batch files using numeric digits to run certain tasks. But, for the serial number utility, I need to enter the characters SY. I normally do this using a USB keyboard. I would like to be able to automate this.

Currently, my batch file, named 2.bat, goes like this:

calldmia.exe 1


calldmia.exe is the utility, and one is the option that takes me to a prompt where I enter the serial number data. Is there any way to make the batch file automatically enter the characters SY at the prompt where I enter the serial number?

for instance, I call the batch file...it launches calldmia.exe and picks option 1, then when it gets to the prompt, it automatically enters SY and then I enter the numeric remainder of the serial number using the numeric keypad.

Any ideas?
I know there has to be a DOS guru around here somewhere!!
 

bsobel

Moderator Emeritus<br>Elite Member
Dec 9, 2001
13,346
0
0
Simply use input redirection e.g.

calldmia.exe < infile.txt

Make infile.txt contain the characters you need inputed (including the crlf). So it might look like this (from your example)

(start of file next line)
1
SY000000
etc
 

Madwand1

Diamond Member
Jan 23, 2006
3,309
0
76
Is there an ALT key? ALT 83 ALT 86 = SV

http://www.ka.net/jmenees/Dos/Ansikeycodes.htm

Otherwise, say your batch file is called 1.bat, and the user launches it with 1 serial# suffix

1.bat does something like

@echo off
echo calldmia.exe 2 SV%1 > callit.cmd
callit.cmd
del callit.cmd

Where I conveniently assume that option 2 takes the serial number from the command line. If not, then combine this with input redirection as bsobel wrote.