Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
The code below tries ti access a file from the folder , and the folder name has space and hence i dont get any output or error message... nothin jus happens... if i place the file in anyother folder that has spaces inbetween then it works totally fine . I tried double quotes also but without any change.Can you please let me know the reason and suggest an alternate.
@echo off > newfile & setLocal enableDELAYedexpansion
set N=
for /f "tokens=* delims= " %%a in (C:\Data\test rest pans\myfile) do (
set /a N+=1
)
set /a X=!N!-10
set N=for /f "tokens=* delims= " %%a in (C:\Data\test rest pans\myfile) do (
set /a N+=1
if !N! gtr !X! echo %%a >> newfile
)

for /f "usebackq tokens=* delims= " %%a in ("C:\Data\test rest pans\myfile") do (Without usebackq double quotes are interpreted as literal strings.
see "start > run > cmd > for /?" for more info.

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |