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.
Batch File Help
Name: skito1_803 Date: April 28, 2005 at 09:40:02 Pacific OS: NT 4 CPU/Ram: PIII 512 MB
Comment:
I am trying to read the last 5 or 10 lines of text from my backup_log.txt file and output it to a file...so far it works but only prints the last line.
@echo off for /f "tokens=*" %%a in (backup_log.txt) do set LastLine=%%a echo %LastLine%
I am new to the FOR statement. Any ideas? Thank you,
Echo. If %2.==. Echo Missing source file & GoTo :EOF If not exist %~f2 Echo File %~f2 not found & Goto :EOF If %3.==. Echo Missing output destination & GoTo :EOF Echo Extracting last %1 lines from %~f2 into %~f3
If exist %~f3 Del %~f3
For /F "tokens=3 delims=:" %%A in ('Find /V /C "#~#" %~f2') Do Set RN=%%A Set /A SN=%RN%-%1 If %SN% leq 0 Echo Too many lines [File contains %RN% lines] & GoTo :EOF Echo Skipping %SN% lines from %RN% For /F "tokens=* skip=%SN% delims=" %%A in (%~f2) Do Echo %%A>> %~f3 Set RN= Set SN= ::*****************
M2
If at first you don't succeed, you're about average.
0
Response Number 2
Name: skito1_803 Date: May 2, 2005 at 14:31:47 Pacific
Reply:
M2,
Wow, Days of hair pulling all solved by IVO. Thanks for the post.
Summary: Thanks to all who replied... unfortunately, I'm no closer. Perhaps some endeavoring soul can tell me why the following batch file isn't working on an NT system- excerpts follow: @ECHO OFF IF Windows_N...
Summary: Hi, I'm sure this is a no brainer for you experts but since I have no brains, here goes: I need a batch file that will stop a SQL service. Copy contents of a folder from one drive (D:\) to a folder ...
Summary: Dear All, Please help me! I'm new to win NT/DOS and am trying to create a Batch file to archive files. First it creates a folder name base on the current date (ex: dir name: c:\09-29-2000), then copy ...