» An ultimate catalog of computer data
Forum posts for stunnel.exe
Batch file creating another batch file, how to ignore commands when writing lines?
having a bit of trouble with a windows batch file I'm writing.
I need the batch file to write some particular lines to another batch file, the method I have been using is:
type NUL > batchfile.bat
ECHO texttobewrittentofile >> batchfile.bat
ECHO texttobewrittentofile >> batchfile.bat
ECHO texttobewrittentofile >> batchfile.bat
...
etc
Most of the lines write fine, there are a few different problems I'm having with my batch file writing to another batch file though.
The code for my batch file to write to another batch file is:
ECHO @echo off >> GenerateEmail.bat
ECHO ECHO Opening Stunnel >> GenerateEmail.bat
ECHO pushd .stunnel >> GenerateEmail.bat
ECHO start '' stunnel.exe stunnel.conf >> GenerateEmail.bat
ECHO popd >> GenerateEmail.bat
ECHO ECHO Determining latest log for use with blat >> GenerateEmail.bat
ECHO pushd O:Logs\%clientname% >> GenerateEmail.bat
ECHO for /f 'tokens=*' %%a in ('dir /b /od') do set newest=%%a >> GenerateEmail.bat
ECHO popd >> GenerateEmail.bat
ECHO ECHO Generating email containing contents of latest log >> GenerateEmail.bat
ECHO pushd .lat307full >> GenerateEmail.bat
ECHO ECHO Y | xcopy 'O:Logs\%clientname%\%newest%' '.' >> GenerateEmail.bat
ECHO blat.exe '%newest%' -to %clientemail% -cc %gmailemail% -server 127.0.0.1:1099 -subject 'Offsite Backup for '%1' '%2' - %clientname%' -sig sig.txt >> GenerateEmail.bat
ECHO DEL .*.log >> GenerateEmail.bat
ECHO popd >> GenerateEmail.bat
ECHO ECHO Closing Stunnel >> GenerateEmail.bat
ECHO pushd .stunnel >> GenerateEmail.bat
ECHO stunnel.exe -exit >> GenerateEmail.bat
ECHO popd >> GenerateEmail.bat
I'm not getting the desired output that I would like, I'm having issues with:
ECHO Y | xcopy 'O:Logs\%clientname%\%newest%' '.' >> GenerateEmail.bat
coming out as
0 File(s) copied
and everywhere that I need %% it comes out as %, as well as the line starting with 'blat.exe' isn't written at all amongst other problems. Is there any way to get a batch file to write lines of text without acknowledging any commands or symbols contained in those lines?
Kane.
View complete forum thread with replies
Other posts related to stunnel.exe
See Related Forum Messages: Follow the Links Below to View Complete Thread
Batch file creating another batch file, how to ignore commands when writing lines?