Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help to decipher what this is saying

Status
Not open for further replies.

elwaysgod

Technical User
Nov 6, 2007
4
US
Hi,
Need help converting this logic into english. Can anyone explain it?


*********************************

@echo off

setlocal

echo REM Begin to copy 'App' dir to backup location > %outFile_CopyAppDir%

pushd "%ess_app_dir_source%"

for /f "tokens=*" %%a in ('dir /b /ad 2^>NUL') do call :pROCDIR "%%a"

popd
 
This is a batch script for Windows NT/2K/XP. Nothing to do with vbscript. Is it a puzzle that someone set you? Looks like a random half written script.

@echo off
Do not echo anything

setlocal
begin local environment changes

echo REM Begin to copy 'App' dir to backup location > %outFile_CopyAppDir%
Stick something in the file %outFile_CopyAppDir%

pushd "%ess_app_dir_source%"
save your current directory and cd %ess_app_dir_source%

for /f "tokens=*" %%a in ('dir /b /ad 2^>NUL') do call :pROCDIR "%%a"
call procdir on all the directories in 2>NUL. The procdir routine is missing from this script. ^ means do not interpret the next character.

popd
return to the directory you came from

Problem with the script: there should be an endlocal here
 
Correction 2^> NUL converts to 2> NUL which means "do not display error output"

I'd forgotten that cmd is similar to Unix in that 1> is normal output and 2> is error output
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top