PDA

Click to See Complete Forum and Search --> : Batch File Variable


JayCR
Jan 26th, 2010, 06:51 AM
Hi All,

going back a decade or two, I am writing a Batch File to filter all the user profiles on the system.

D:\TSprofiles1\UsersNames is the location of all the files. normally I would use a command similar to


dp1.bat
CD D:\
CD D:\TSprofiles1
DEL D:\TSprofiles1\%1\Cookies\*.*
DEL D:\TSprofiles1\%1\Temporary Internet Files\*.*

Call DP1.bat UserName
Call DP1.bat User2Name
Call DP1.bat User3Name


However I am not sure if this will work on a windows server 2000. Is the %1 the variable to access all folders and subfolders within?

dbasnett
Jan 26th, 2010, 01:29 PM
dp1.bat foo

If this is dp1.bat
CD D:\
CD D:\TSprofiles1
DEL D:\TSprofiles1\%1\Cookies\*.*
DEL D:\TSprofiles1\%1\Temporary Internet Files\*.*

then

CD D:\
CD D:\TSprofiles1
DEL D:\TSprofiles1\foo\Cookies\*.*
DEL D:\TSprofiles1\foo\Temporary Internet Files\*.*

JayCR
Jan 27th, 2010, 04:51 AM
so how does foo recognise that I want to act upon each of the sub folders in the profiles directory?