Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accepting Inputs in a batch file 1

Status
Not open for further replies.

pdb123

IS-IT--Management
Dec 8, 2004
21
FR
I want to start using batch files to simplify routine parts of my job ie: convert usb keys to NTFS.
The dos commands are easy enough what i need to know is how do i accept an input through dos.

Code example
ECHO Enter Drive Letter?
Get x // I know this wrong

convert x /fs:ntfs

any help would be greatly appreciated

Also if anyone has a good ebook on scripting can thy recomend (preferably free)
cheers

 
Hi, have you tried %1 instead of x

The best book I know about scripting batch files is the old DOS 5.0 "bible". You can certainly have this at your local store for under 10$

Hope this helps. Please let me know if this resolve your issue

Jeff
 
This thread has several ideas you could look at to see if they help.

Batch parameter
thread779-279482
 
thanks JFBOUCHARD,
I have a background in programming c++ and Java and I think it is hindering me at the moment.
Can you spell it out to me what i have is:

LOAD ANSI.sys
ECHO: Enter A value
%1%
convert %1; /fs:ntfs

It is not giving me the option to enter the valu I am fairly confident the command portion would work.

Havn't looked at the link as of yet will do now though.
 
ANSI.SYS is not needed.

@echo off
setlocal
:getname
cls
set /p drive=Enter drive letter or END to exit.
if /i [%drive%]==[END] endlocal & goto end
if [%drive%]==[] goto getname
if exist %drive%:\ goto do_ntfs
echo Drive %drive% does not exist. Try again.
goto getname
:do_ntfs
echo Converting %drive% to NTFS
convert %drive%: /fs:NTFS
:end
echo done


 
Pdb123, here's your answer from bcastner

A star for you Bill.

Nice day

Jeff
 
Thanks a lot you guys.
I think I will be able to modify this for other dreary tasks. If theres any thing I can do for you guys never be afraid to ask, but something tells me you wont need it!!
thanks again
PDB123
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top