Familiar with DOS
Results 1 to 5 of 5

Thread: Familiar with DOS

  1. #1
    Registered User Akuma's Avatar
    Join Date
    Nov 2001
    Location
    The Void
    Posts
    826

    Question Familiar with DOS

    I need a DOS batch file to run on a Windows 2000 machine that will allow the user to input the name of a file, and that user defined file will be appened to a header file, and the appended information will be put into a new file. Can anyone help? Thanks in advance.
    Sooouuuushi!

  2. #2
    Registered User arch0nmyc0n's Avatar
    Join Date
    Oct 2002
    Location
    It's all relative.
    Posts
    1,820
    Well I suppose to could be possible as long as you run the batch file with the file name ie: a:\batchfile filename.txt then use the append command. I have dealt with batchfile processing in the past, been a while tho.
    "We must always fear the wicked. But there is another kind of evil that we must fear the most, and that is the indifference of good men." -- Monsignor; The Boondock Saints.

  3. #3
    Registered User deepblu's Avatar
    Join Date
    Mar 2003
    Location
    Portland, Oregon
    Posts
    52

    Been a long time since I rock an' roll

    Quote Originally Posted by Akuma
    I need a DOS batch file to run on a Windows 2000 machine that will allow the user to input the name of a file, and that user defined file will be appened to a header file, and the appended information will be put into a new file. Can anyone help? Thanks in advance.

    A good resource for this is : http://www.labmice.net/scripting/
    Could not hit the curveball

  4. #4
    Registered User rockymount's Avatar
    Join Date
    Jan 2004
    Posts
    3
    Try this DOS code in a batch file:
    _____________________
    @ECHO off
    :: filname.bat
    IF "%1"=="" ECHO. must enter existing filename
    IF "%1"=="" GOTO end
    IF not exist %1 ECHO. file "%1" does not exist
    IF not exist %1 GOTO end
    IF exist enter.bat ECHO. enter.bat in current directory
    IF exist enter.bat GOTO end
    PATH>%temp%.\respath.bat
    PATH %temp%;%path%
    DIR/A-D/B/L/-P %1. > %temp%.\filname1.dat
    ECHO. >> %temp%.\filname1.dat
    DATE <%temp%.\filname1.dat | find "):" > %temp%.\filname1.bat
    ECHO set fnam=%%4> %temp%.\enter.bat
    FOR %%C in (call del) do %%C %temp%.\filname1.bat
    FOR %%F IN (%temp%.\filname1.dat %temp%.\enter.bat) do DEL %%F
    FOR %%C in (call del) do %%C %temp%.\respath.bat
    :end
    copy header.txt+%1 final.txt
    ________________________

    You will need a file called header.txt that contains the header info.
    The user's filename must exist and the end result will be a file called final.txt that contains the appended data.

    Hope this helps.

  5. #5
    Geezer confus-ed's Avatar
    Join Date
    Jul 1999
    Location
    In front of my PC....
    Posts
    13,087
    Well you get a for that as a 'first post' ... welcome to windrivers rockymount

    Anyone tested this yet ? I'm as usual confus-ed by the original requirements, but this seems a 'very reasonable stab' to me

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •