Appending variable to file name problem.

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
stg68
Posts: 4
Joined: 07 Sep 2011 01:14

Appending variable to file name problem.

#1 Post by stg68 » 07 Sep 2011 01:24

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

Exouxas
Posts: 34
Joined: 01 Sep 2011 12:52

Re: Appending variable to file name problem.

#2 Post by Exouxas » 07 Sep 2011 08:03

Code: Select all

@ECHO OFF

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


you added a ' ' (space) after fn.

stg68
Posts: 4
Joined: 07 Sep 2011 01:14

Re: Appending variable to file name problem.

#3 Post by stg68 » 07 Sep 2011 08:12

Thank you so much for your help!

Exouxas
Posts: 34
Joined: 01 Sep 2011 12:52

Re: Appending variable to file name problem.

#4 Post by Exouxas » 07 Sep 2011 08:35

You're very much welcome fellow scripter :P

Post Reply