Computing.Net > Forums > Windows 2000 > adding a user prompt to bat script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

adding a user prompt to bat script

Reply to Message Icon

Name: postman
Date: April 7, 2005 at 05:43:41 Pacific
OS: win2k
CPU/Ram: 500
Comment:

the following script allows the user to take a large txt file and break it up into smaller txt files:

@Echo Off

:: CTXT.BAT Syntax: CTxt [Unit:][PathName]FileName

:: Cut-down the specified file in pieces of 50 lines each
:: naming FileName_nn.ext starting from 01.
:: Win NT/2K/XP required; blanks not allowed in FName

If not %1.==[]. (
Cmd /V:On /C Call %0 [] %1
GoTo :EOF)

Shift
Echo.
If %1.==. (Echo File missing & GoTo :EOF)
If not exist %~f1 (
Echo File %~f1 not found
GoTo :EOF)

Set Piece=50
Set Count=1
Set FileN=1
Set FileS=0!FileN!

Echo Cutting-down %~f1 in pieces of !Piece! lines...
Echo.
If exist %~dpn1_*%~x1 Del %~dpn1_*%~x1

For /F "tokens=* delims=" %%A in (%1) Do (
Echo %%A>> %~dpn1_!FileS!%~x1
Set /A Count=!Count!+1
If !Count! gtr !Piece! (
Set Count=1
Set /A FileN=!FileN!+1
Set FileS=!FileN!
If !FileS! lss 10 Set FileS=0!FileS!
)
)
Dir /B %~dpn1_*%~x1
Echo.
Echo Processing completed - !FileN! files written

Set Count=
Set FileN=
Set FileS=
Set Piece=

my question is what can i add to this script to prompt the user as follows:

how many lines do you want to use?

(it is set at 50)



Sponsored Link
Ads by Google

Response Number 1
Name: FishMonger
Date: April 8, 2005 at 11:06:39 Pacific
Reply:

set /P Count=how many lines do you want to use?


0

Response Number 2
Name: FishMonger
Date: April 8, 2005 at 11:08:06 Pacific
Reply:

Oops, wrong variable; should be

set /P Piece=how many lines do you want to use?


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Windows 2000 Forum Home


Sponsored links

Ads by Google


Results for: adding a user prompt to bat script

How add a user to an OU via script www.computing.net/answers/windows-2000/how-add-a-user-to-an-ou-via-script/38708.html

Adding Win2k Pro Client to Win2k Domain www.computing.net/answers/windows-2000/adding-win2k-pro-client-to-win2k-domain/17959.html

Windows 2000 USER access to CD buners?? www.computing.net/answers/windows-2000/windows-2000-user-access-to-cd-buners/18953.html