Set Var not working

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
radcaesar
Posts: 4
Joined: 13 Apr 2010 08:52

Set Var not working

#1 Post by radcaesar » 13 Apr 2010 08:57

In the below file, filecount.txt have count "20" but the variable "varFilecount" shows "0" when echo.

Any Idea?

dir "c:\MCSLoad\*.txt" | find /c ".txt" >> filecount.txt
set /P varFileCount=<filecount.txt
echo varFileCount
REM del filecount.txt

!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

Re: Set Var not working

#2 Post by !k » 13 Apr 2010 09:03

echo %varFileCount%

radcaesar
Posts: 4
Joined: 13 Apr 2010 08:52

Re: Set Var not working

#3 Post by radcaesar » 13 Apr 2010 09:05

oops..... I don't know how i missed it out.

Thanks.

Post Reply