Page 1 of 1

Appending variable to file name problem.

Posted: 07 Sep 2011 01:24
by stg68
Please help. (Windows 7) The following script creates “SUCCESS_.log” file
Expecting SUCCESS_12_myfile.log

What I am doing wrong? Thanks!

@ECHO OFF

SET fn =12_myfile
echo ENDED %TIME% %DATE%>>SUCCESS_%fn%.log

Re: Appending variable to file name problem.

Posted: 07 Sep 2011 08:03
by Exouxas

Code: Select all

@ECHO OFF

SET fn=12_myfile
echo ENDED %TIME% %DATE%> SUCCESS_%fn%.log


you added a ' ' (space) after fn.

Re: Appending variable to file name problem.

Posted: 07 Sep 2011 08:12
by stg68
Thank you so much for your help!

Re: Appending variable to file name problem.

Posted: 07 Sep 2011 08:35
by Exouxas
You're very much welcome fellow scripter :P