New
#1
Windows 7 creating blank txt file after running a batch script
I have the following batch script
The problem is that when i run it on my windows 7 desktop, it creates an empty txt file in comparison to my windows 8 laptop, where it creates the dns record that i need.Code:@echo off setlocal enableextensions set "baseName=dnshistory" set "count=0" for /f "delims=%baseName%." %%a in ( 'dir /b /o-d "%baseName%*.txt" 2^>nul' ) do ( set /a "count=%%a+1" & goto saveData ) :saveData ipconfig /displaydns | find "Record Name" > "%baseName%%count%.txt"
Does anyone knows why this happens on windows 7 ?