Search found 244 matches

by Endoro
30 Mar 2013 03:09
Forum: DOS Batch Forum
Topic: Looking to grab the names of all folders in a directory
Replies: 5
Views: 1915

Re: Looking to grab the names of all folders in a directory

Why not do the output in the for loop:

Code: Select all

@echo off&setlocal enabledelayedexpansion
set /a count=0
for /f "delims=" %%i in ('dir /ad /b') do (
   set /a count+=1
   echo !count!^) %%~i
)
by Endoro
29 Mar 2013 02:42
Forum: DOS Batch Forum
Topic: Setlocal/Endlocal commands save/restore current directory!
Replies: 10
Views: 7154

Re: Setlocal/Endlocal automatically push/pop current directo

"endlocal automatically restores %cd%"

(btw. no surprising news about environment variables)
by Endoro
28 Mar 2013 18:05
Forum: DOS Batch Forum
Topic: Reading Part of a File Name
Replies: 1
Views: 1225

Re: Reading Part of a File Name

What do you mean with 'part of a file name'?

Btw. you shouldn't use predefined batch variables like %date% and %time% for other purposes.
by Endoro
28 Mar 2013 06:12
Forum: DOS Batch Forum
Topic: Setlocal/Endlocal commands save/restore current directory!
Replies: 10
Views: 7154

Re: Setlocal/Endlocal automatically push/pop current directo

setlocal/endlocal do restore the current directory but do not clear the pushd directory stack and do not remove with pushd created LAN drive letters