Question

ntbackup batch file/script?

Asked by: omb

We would like to use NTBACKUP as a cheap solution to backups. Scheduled to run every evening is easy. However, we also would like the .log file to be printed out or emailed and the tape to be ejected on completion. Probably best to use a batch file or script - any ideas?

Thanks.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-03-17 at 02:22:54ID20921686
Tags

ntbackup

,

script

Topic

Windows 2000 Operating System

Participating Experts
4
Points
100
Comments
27

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. WinXP: Eject 4mm dat Tape after ntbackup
    I tried with rsm eject /pf"..." /astart but it doesn't work. Also modify HKEY_CURREN_USER\Software\Microsoft\Ntbackup\UserInterfaceat EjectTapeFlag --> 1 Same story! Anybody can help me??? Tanks!
  2. NTBackup not releasing tape
    Hello, I am having problems with Std WinSvr2003 and NTBackup not releasing the tape after it has backed up. I'm using a Sony AIT 35/70Gb LVD drive in a Proliant ML350. My command i'm using to do the backup is... "C:\WINDOWS\system32\ntbackup.exe backup "@C:\Documen...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: diggisaurPosted on 2004-03-17 at 06:41:34ID: 10615471

You should be able to schedule all this and all these options with the NTBACKUP schedule tab.

 

by: ombPosted on 2004-03-17 at 07:29:15ID: 10615911

I certainly can't find any options on the NTbackup schedule tab - please can you let me know where they are hidden. Thx

 

by: pbarrettePosted on 2004-03-17 at 08:02:18ID: 10616239

Hi omb,

Look here for some ideas on Win2k's NTBACKUP scripting:
http://www.jsiinc.com/SUBE/tip2200/rh2265.htm

A good example of dealing with tape mounting problems. Also includes a link on how to use BLAT for emailing:
http://www.jsiinc.com/SUBL/tip5900/rh5955.htm

pb

 

by: ombPosted on 2004-03-17 at 09:35:20ID: 10617066

Thanks for the feedback pbarrette - some great links and I'm getting a lot further with the backup script now!

Once slight problem.. any idea how I determine the name of the ntbackup log file so that this can also be attached with the email I send use BLAT? Can a variable be used to determine the new log file name? Or how about getting ntbackup to always use the name log file name? but how?

Thanks for all your help.

 

by: 4auHukPosted on 2004-03-17 at 10:35:12ID: 10617576

omb,
In my blat+ntbackup batch script i determine most recent log after ntbackup ends and email it if ntbackup succeed.
Like this:
---cut---

set bkpp="%USERPROFILE%\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data"
set subj="Daily backup report"
set blatbody="%temp%\%random%%random%.txt"
set recipient=my@email.com

pushd %bkpp%
for /f "tokens=1 delims=" %%I in ('dir /B /O-D') do (
   if "%%~xI"==".log" (
     type "%%~fI" > %blatbody%
     goto :eof
   )
)
popd
C:\bin\blat.exe %blatbody% -s %subj% -to %recipient%
del /q /f "%blatbody%"

---cut---

 

by: pbarrettePosted on 2004-03-17 at 10:39:48ID: 10617611

Hi omb,

You will have to use something like the following to find the log file that was modified last:
:: ------------EXAMPLE.BAT------------
@ECHO OFF
SET LOGDIR=C:\Documents and Settings\%USERNAME%\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\Data
FOR /F %%F IN ('DIR /B /A-D /O-D /TW "%LOGDIR%\Backup??.log"') DO (
 SET LOGFILE=%%F
 GOTO GOTLOG
)
:GOTLOG
ECHO Last modified logfile is "%LOGDIR%\%LOGFILE%"
:: ------------EXAMPLE.BAT------------

Hope this helps,
pb

 

by: pbarrettePosted on 2004-03-17 at 10:46:40ID: 10617678

Hi 4auHuk,

Didn't see your post before I replied..

Anyway, it isn't necessary to create another file for this. You can just use something like:
BLAT -t me@myemail.com -s "Backup Log for %DATE%-%TIME%" -attach "%LOGDIR%\%LOGFILE%"

This, of course, is based on my above example, but will work for any BLAT message, provided you have a path and filename.

pb

 

by: 4auHukPosted on 2004-03-17 at 10:51:33ID: 10617707

No problem,
I cut-paste these parts from my script in wich i have a reason to create another file for blat message body. In case of ntbackup failure body gets error notification, in case of success it gets header, backup log content and footer.
If you send backup log as attachment sure you do not need to create an extra file.

4auHuk.

 

by: 4auHukPosted on 2004-03-17 at 11:00:42ID: 10617767

Just as addon:
If ntbackup fails, depending on a stage at wich failure occurs (say, ntbackup fails to start completely due to error in switches which are composed dynamically or for some other reason) ntbackup may not create log. In this case you can recieve wrong log file. You should handle this possible behaviour in your script.

4auHuk

 

by: 4auHukPosted on 2004-03-17 at 11:06:54ID: 10617820

Just noticed my example will not send an e-mail since "goto :eof" will skip blat command. Did not change this when psted sub from my script. Should be

pushd %bkpp%
for /f "tokens=1 delims=" %%I in ('dir /B /O-D') do (
   if "%%~xI"==".log" (
     type "%%~fI" > %blatbody%
     goto send
   )
)
:send
popd
C:\bin\blat.exe %blatbody% -s %subj% -to %recipient%
del /q /f "%blatbody%"

 

by: ombPosted on 2004-03-18 at 04:16:14ID: 10623105

Wow guys, what tremendous feeback... so here are a few more points ;o)... having 'played' with both scripts, I have several questions:

4auHuk: I like the idea of having a 'blatbody' variable in order to customise messages depending on backup outcome. However, I can't get it to work?! Every time the script runs, it says that the file cannot be found. Blat then fails as it can't find the blatbody message text. The bits I am looking at are:
   set blatbody="%temp%\%random%%random%.txt"
   type "%%~fI" > %blatbody%
   del /q /f "%blatbody%"

pbarrette: Your script which finds the log file that was modified last works great. For some reason, I couldn't get 4auHuk's to work. BTW, I am a scripting novice so go easy on me. However, I kind of understand your scripts and they kind of work!

I use the following to send the email (variables defined above):
%blat% %blatbody1% -to %recipient% -s %subj1% -attach "%LOGDIR%\%LOGFILE%"

I have used a combination of both scripts and also tried to include a little error checking (check for a tape) as in article http://www.jsiinc.com/SUBL/tip5900/rh5955.htm - but I have a problem with accented characters. Unfortunately, some of the OS installations I use are in German, so sentences such as "The command completed successfully."  are translated as "Der Befehl wurde ausgeführt.". Hence the error checking does not really work - the "ü" is not correctly displayed when run. The bit of the script I am referring to is:

if not "%%a"=="The command completed successfully." set media="%%a"
rem (or in German...)
if not "%%a"=="Der Befehl wurde ausgeführt." set media="%%a"

Thanks so much for your invaluable feedback and support.

 

by: ombPosted on 2004-03-18 at 04:55:20ID: 10623293

I've just had another look at the error checking script and am totally confused :o(... With a tape in the drive, I run:

rsm view /cg%guiddisplay% /TPhysical_media

and receive a display:

PHYSICAL_MEDIA
Tape_label_name - 1
The command completed successfully.

When I run the same command without a tape in the drive, I receive:

PHYSICAL_MEDIA

The command completed successfully.

I can't make sense of the the script (below). Which part of the script is looking for my blank line, which is where the tape label would be if there was a tape in the drive?

:checkmedia
set media=
for /f "Tokens=*" %%a in ('rsm view /cgC888E08900454C4C956DF84868C17C78 /TPhysical_media') do (
 if not "%%a"=="The command completed successfully." set media="%%a"
)
if /i %media% EQU "Unable to open session with the RSM server." goto checkmedia
if /i %media% EQU "PHYSICAL_MEDIA" goto notape
if not defined media goto notape

All I want to be able to test is whether there is a tape in the drive or not - if yes, run the backup and send email with backup log, if no, abort backup and send email saying backup failed. So close, but yet so far! Thanks again for your comments...

 

by: 4auHukPosted on 2004-03-18 at 05:22:51ID: 10623465

Not sure what is the prolbem.
You can remove @echo off in your script for troublrshooting.
At which line(s) you get this error?
You can also insert "echo %blatbody% & pause" after "set blatbody" to see what you get in variable. Same for other variables.

If for some reason "%temp%\%random%%random%.txt" is what causes problems you can set blatbody to whatever you wish. E.g. c:\winnt\temp\blatbody.txt

4auHuk

 

by: pbarrettePosted on 2004-03-18 at 09:53:44ID: 10626007

Hi omb,

Try this instead:
:: ----------EXAMPLE.BAT----------
@ECHO OFF
SET MEDIA=
SET LINE=

FOR /F "SKIP=2 DELIMS=" %%F IN ('rsm view /cg%guiddisplay% /TPhysical_media') DO (
 SET LINE=%%F
 CALL :PROCESS
)
GOTO GOTTAPE

:PROCESS
ECHO %LINE% | FINDSTR "The command" > NUL
IF ERRORLEVEL 1 (
 ECHO %LINE% | FINDSTR "Der Befehl" > NUL
 IF ERRORLEVEL 1 (
  SET MEDIA=%LINE%
 )
)
GOTO :EOF

:NOTAPE
ECHO Where's my Tape?
ECHO BLAT -Send-Me-A-Nastygram-Now
GOTO :EOF

:GOTTAPE
IF NOT DEFINED MEDIA ( GOTO NOTAPE )
ECHO Media Name = "%MEDIA%"
:: ----------EXAMPLE.BAT----------

You will need to replace %guiddisplay% with your GUID, of course.

Both the original script and mine aren't looking for the media name explicitly. Both are actually looking at the line immediately preceeding the "Successful" text. This line contains the media name in mine (Since I am SKIPping the PHYSICAL_MEDIA text) and contains either the media name or "PHYSICAL_MEDIA" in the original.

Hope this helps,
pb

 

by: ombPosted on 2004-03-19 at 03:54:24ID: 10632221

Great stuff guys...

4auHuk, I changed:

type "%%~fI" > %blatbody%
   to
echo "%%~fI" > %blatbody%

...works great with the temp files & msg variables.

pbarrette, I changed:

ECHO %LINE% | FINDSTR "The command" > NUL
  to
ECHO %LINE% | FINDSTR "Der Befehl" > NUL

...the script works perfect and sends different messages depending on if there is a tape in the drive or not - yeee haaa! Will this also work if I insert a brand new tape (which has been never used before)?

FYI, my script now looks like this:

:: ----------BACKUP.BAT----------

set LOGDIR=%USERPROFILE%\Lokale Einstellungen\Anwendungsdaten\Microsoft\Windows NT\NTBackup\data
set subj1="%computername% Backup Failure"
set subj2="%computername% Backup Successful"
set recipient=alias@domain.de
set blatErrorText=Backup error text for %computername% at %USERDOMAIN% on
set blatOKtext=Backup ran OK text for %computername% at %USERDOMAIN% on
set guiddisplay=E759FC802D61406A9C1B1DDC6764ABEE
set ntbackup=d:\WINNT\system32\NTBACKUP.EXE
set bks=d:\backup\daily.bks
set blat=d:\downloads\blat\blat.exe
set DDSdevice=HP C1537A SCSI Sequential Device

set blatErrorFile="%temp%\%random%%random%.txt"
set blatOKfile="%temp%\%random%%random%.txt"
SET MEDIA=
SET LINE=

rsm.exe inventory /LF"%DDSdevice%" /AFULL
sleep 30
for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i-%%j%%k%%l
for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
set dtt=%dt%%tm%
FOR /F "SKIP=2 DELIMS=" %%F IN ('rsm view /cg%guiddisplay% /TPhysical_media') DO (
 SET LINE=%%F
 CALL :PROCESS
)
GOTO :GOTTAPE

:PROCESS
ECHO %LINE% | FINDSTR "Der Befehl" > NUL
IF ERRORLEVEL 1 (
 ECHO %LINE% | FINDSTR "Der Befehl" > NUL
 IF ERRORLEVEL 1 (
  SET MEDIA=%LINE%
 )
)
GOTO :EOF

:NOTAPE
echo %blatErrorText% %dtt% > %blatErrorFile%
%blat% %blatErrorFile% -to %recipient% -s %subj1%
del /q /f "%blatErrorFile%"
GOTO :EOF

:GOTTAPE
IF NOT DEFINED MEDIA ( GOTO NOTAPE )
ECHO Media Name = "%MEDIA%"

:RUNBACKUP
%ntbackup% backup "@%bks%" /n "%computername%-%dtt%" /d "%computername% voll Sicherung" /v:no /r:no /rs:no /hc:on /m normal /j "%computername% voll Sicherung" /l:s /p "4mm DDS" /UM
rsm.exe eject /PF"%computername%-%dtt% - 1" /astart

:BACKUPRAN
FOR /F %%F IN ('DIR /B /A-D /O-D /TW "%LOGDIR%\Backup??.log"') DO (
 SET LOGFILE=%%F
)
ECHO Last modified logfile is "%LOGDIR%\%LOGFILE%"
echo %blatOKtext% %dtt% > %blatOKfile%
%blat% %blatOKfile% -to %recipient% -s %subj2% -attach "%LOGDIR%\%LOGFILE%"
del /q /f "%blatOKfile%"
goto :EOF

:EOF
exit

:: ----------BACKUP.BAT----------

Any final comments or suggestions on my script? Just a thought, what would happen if the scheduled task is manually stopped or automatically ended after x hours (option in scheduler)? Do I also need error checking here? Thanks so much for all your tremendous help... and more points for my appreciation :0)

 

by: pbarrettePosted on 2004-03-19 at 09:06:39ID: 10634653

Hi omb,

You didn't need to change the line from my script. I set it up such that it should work correctly on both english and german systems.

Also, ":EOF" is a special label that states "End of File" so you don't actually need a label in your batchfile for it since it will be ignored.

Finally, your logfile routine will send the oldest log instead of the newest one.

It should be:
:: ---------------------------
:BACKUPRAN
FOR /F %%F IN ('DIR /B /A-D /O-D /TW "%LOGDIR%\Backup??.log"') DO (
 SET LOGFILE=%%F
 GOTO GOTLOG
)
:GOTLOG
ECHO Last modified logfile is "%LOGDIR%\%LOGFILE%"
echo %blatOKtext% %dtt% > %blatOKfile%
%blat% %blatOKfile% -to %recipient% -s %subj2% -attach "%LOGDIR%\%LOGFILE%"
del /q /f "%blatOKfile%"
:: ---------------------------

Alternately, it could be:
:: ---------------------------
:BACKUPRAN
FOR /F %%F IN ('DIR /B /A-D /OD /TW "%LOGDIR%\Backup??.log"') DO (
 SET LOGFILE=%%F
)
ECHO Last modified logfile is "%LOGDIR%\%LOGFILE%"
echo %blatOKtext% %dtt% > %blatOKfile%
%blat% %blatOKfile% -to %recipient% -s %subj2% -attach "%LOGDIR%\%LOGFILE%"
del /q /f "%blatOKfile%"
:: ---------------------------

Hope this helps,
pb

 

by: ombPosted on 2004-03-29 at 07:26:44ID: 10704809

Thanks for the EOF label info - nice to know! The correct log is now emailed - great. Batch file now tried and tested in a live environment and it works perfect.

After lots and lots of testing, just found 1 problem... if one of the tapes in the drive had not been "prepared" in Computer Manager, Removable devices etc... although it was in the drive, and NTbackup tried to write to it, the whole process failed. The log file mentioned something about not being able to find correct media. However, the email that was sent said that the backup was successful (of course it did, 'coz it only checks to see if a tape is in the drive) - only looking into the attached log file could I see that the back was unsuccessful. Is there a way I can also error-trap this type of message?

Many thanks and more points!

 

by: pbarrettePosted on 2004-03-29 at 12:03:42ID: 10707386

Hi omb,

If you could post the exact message that occurs when ntbackup determines that the tape isn't prepared, that message could probably be filtered and parsed to alter the email notification.

Alternately, you could add an additional step to parse the backup log to search for an error condition, then add that error condition to the email.

Something like:
:: -------EXAMPLE--------
:CHECKLOGFORERRORS
ECHO "%LOGDIR%\%LOGFILE%" | FINDSTR "ErrorCode1 ErrorCode2 ErrorCode3 Etc" > NUL
IF NOT ERRORLEVEL 1 (
 ECHO "We found an errorcode in the backup logs"
 GOTO DoSomethingAboutIt
)
:: -------EXAMPLE--------

Since you are emailing the log file, you can decide if you want to add additional parsing to get the exact error line, but a general error condition in the subject line is probably enough.

If not, you could probably get the error string itself by parsing the log using "FOR /F".. Something like this, perhaps:
:: -------EXAMPLE--------
FOR /F "DELIMS=" %%F IN ("%LOGDIR%\%LOGFILE%") DO (
 SET LINE=%%F
 CALL :PROCLOGERRCHECK
)
GOTO NEXTFUNCTION

:PROCLOGERRCHECK
ECHO %LINE% | FINDSTR "ErrorCode1 ErrorCode2 ErrorCode3 Etc" > NUL
IF NOT ERRORLEVEL 1 (
 SET LASTERRCODE = %LINE%
)
GOTO :EOF
:: -------EXAMPLE--------

With this, %LASTERRCODE% would contain the text of the line with the last error condition found in the logfile. You could then incorporate that into your BLAT subject.

A better way of handling this specific error might be to see if there is a way you can determine if the tape is "prepared" for use using RSM. If RSM can output parsable data that signifies a tape's "preparedness" then that could be used to abort the backup attempt and send an email. It could possibly even be used to select a different backup location depending upon your setup.

Hope this helps,
pb

 

by: ombPosted on 2004-03-30 at 06:30:00ID: 10713723

Many thanks for your feedback pb. I will try out your suggestions and let you know the results...

 

by: ombPosted on 2004-04-02 at 06:58:24ID: 10741061

Hi pb. I liked the idea of checking bits within the actual log files so that different messages could be parsed to the emails. I used your first example to check for 2 different conditions within the backup log file, as follows:

:CHECKLOGFORERRORS
ECHO "%LOGDIR%\%LOGFILE%" | FINDSTR "Die gesicherten Daten sind beschädigt oder unvollständig" > NUL
IF NOT ERRORLEVEL 1 (
 ECHO "%BackupError1%"
 set BackupErrorText=%BackupError1%
 GOTO BACKUPnotOK
)

ECHO "%LOGDIR%\%LOGFILE%" | FINDSTR "Der Vorgang wurde nicht durchgeführt, da die angegebenen Medien nicht gefunden wurden" > NUL
IF NOT ERRORLEVEL 1 (
 ECHO "%BackupError2%"
 set BackupErrorText=%BackupError2%
 GOTO BACKUPnotOK
)
GOTO :BACKUPOK

Does FINDSTR search for the complete text between the 2 quotes "..." or any word? It is important that it finds the whole sentence. I also wasn't sure how to combine both search in 1 command line, hence the FINDSTR twice. This script is getting real cool - thanks so much for all of your help and patience with my non-existent programming skills!

 

by: pbarrettePosted on 2004-04-02 at 08:08:02ID: 10741791

Hi omb,

FINDSTR by default will match any space delimited keywords. To get it to match exact sentances, complete with spaces, you must use "/C" like this:
FINDSTR /C:"Der Vorgang wurde nicht durchgeführt, da die angegebenen Medien nicht gefunden wurden"

You can also use multiple occurrences of "/C" to search for multiple items, like this:
FINDSTR /C:"Medien nicht gefunden" /C:"Daten sind beschädigt"

In this example, I used the relevent portions of each search string since there is a command-line length limit and the line is easier to read when editing the batchfile later.

Hope this helps,
pb

 

by: pbarrettePosted on 2004-07-06 at 10:35:10ID: 11483617

Hi Turn123,

I'd suggest a split here.

pb

 

by: ombPosted on 2004-07-07 at 00:38:18ID: 11489053

Sorry that I have not come back on this issue - unfortunately I overlooked the fact that I hadn't graded this question and given due credit to those that helped. The feedback, esp. from pbarrette was outstanding A1. Thanks again for all your help - batch file works great.

 

by: pbarrettePosted on 2004-07-07 at 21:55:31ID: 11498747

Hi Omb,

Glad to be of help.

Don't worry too much about the lateness. I actually got a bit bored here a while back and haven't been visiting unless I get an email notification from an old question. So it's like visiting an old friend.

pb

 

by: Grime121Posted on 2004-09-20 at 08:06:31ID: 12102788

I would be very grateful if you could post the final version of your batch file, omb. It's hard to piece it all together from this thread. Thanks. :)

 

by: ombPosted on 2005-06-14 at 04:54:34ID: 14210158

calling pbarrette... help me please! I've discovered the script that you wrote for me does NOT 100% work - my fault. I would really appreciate your help again, please see a new call I've opened "http://www.experts-exchange.com/Operating_Systems/Win2000/Q_21457271.html" - thanks.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...