Search found 8 matches

by fkjhr4e8d
12 Apr 2022 04:38
Forum: DOS Batch Forum
Topic: Searching a string within a text file
Replies: 5
Views: 6306

Re: Searching a string within a text file

@ShadowThief: Thanks. Worked (and I have a better understanding of how to get to the different outputs)
by fkjhr4e8d
08 Apr 2022 13:38
Forum: DOS Batch Forum
Topic: Searching a string within a text file
Replies: 5
Views: 6306

Re: Searching a string within a text file

What does the 2 > &1 actually do? 2 refers to stderr ("standard error"), which is an output stream that things write errors to if they've been coded correctly > is a redirection operator for moving the contents of output streams somewhere else & in this particular instance is an indicator that the ...
by fkjhr4e8d
08 Apr 2022 06:46
Forum: DOS Batch Forum
Topic: Searching a string within a text file
Replies: 5
Views: 6306

Re: Searching a string within a text file

You are just trying to find out if text is present in the file? Why not something as simple as: type "%programfiles(x86)%\sendEmail\sendemail.log" |findstr /c:"Email was sent successfully!" >nul 2>&1 if %errorlevel% EQU 0 ( echo do something if found ) else ( echo do something if not found ) Replac...
by fkjhr4e8d
06 Apr 2022 06:11
Forum: DOS Batch Forum
Topic: Searching a string within a text file
Replies: 5
Views: 6306

Searching a string within a text file

I have what should be a simple solution. I have a text file called sendemail.log with the following text in it Apr 06 13:28:37 acb-pc sendEmail.exe[2452]: Email was sent successfully! From: <xxx@yyy.net> To: <zzz@aaa.com> Subject: [This is the subject] Server: [smtp.yyyy.net:99] I need to search for...
by fkjhr4e8d
06 Apr 2022 05:55
Forum: DOS Batch Forum
Topic: Problem contactenating a string
Replies: 4
Views: 5793

Re: Problem contactenating a string

I know I was not going senile :D

I just realised that the approval by the admin resulted in the flow not appearing to be logical.
by fkjhr4e8d
06 Apr 2022 00:41
Forum: DOS Batch Forum
Topic: Problem contactenating a string
Replies: 4
Views: 5793

Re: Problem contactenating a string

Hi, I have been using sendemail for over 10 years and it is a nifty free utility that is great when you want a process to send an email. Today you normally need to combine it with a utility that handles the encryption aspects of the communication. I use STunnel for that. -f is an issue only if the p...
by fkjhr4e8d
05 Apr 2022 07:23
Forum: DOS Batch Forum
Topic: Problem contactenating a string
Replies: 4
Views: 5793

Re: Problem contactenating a string

The problem was related to the evaluation of the variables. SETLOCAL EnableDelayedExpansion resolved the issue and using ! rather than % . It controls when a variable is expanded (at the beginning or when it is used). the modified code reads as follows SETLOCAL EnableDelayedExpansion REM Parameters:...
by fkjhr4e8d
05 Apr 2022 05:19
Forum: DOS Batch Forum
Topic: Problem contactenating a string
Replies: 4
Views: 5793

Problem contactenating a string

I have a batchfile that will assemble a command line passed on passed parameters. REM Parameters: REM To (required) REM To (Optional) - NA to indicate empty REM Subject (required) REM Message (required) REM AttachFile1 (optional) - NA to indicate empty REM AttachFile2 (optional) - NA to indicate emp...