bwestlake Posted June 22, 2012 Posted June 22, 2012 I have created a batchfile that removes listed swf games, eg.. del "%Folder%\3d-missile.swf" /S /F /Q >> %TextFile% then just all the games we have found like that, but i have gathered together a mass of games and would like to get a batch file to check against this folder of games and then remove from the students home drives. any ideas
X-13 Posted June 22, 2012 Posted June 22, 2012 (edited) I'm not sure what you're asking. Do you want to check against %TextFile%, add it into %TextFile% if it isn't there and then delete %game%.swf? Le EDIT: Coffee just kicked in. Check the list, delete if on the list. Le EDIT MK.2: You're looking at a loop within a loop with a conditional command. 1) List the directory of the user area [set file = variableA] [FOR /F %%A in (DIR \\server\share\userarea /S /B)] 2) Set content of blacklist as a variable. [Each file = variableB] [FOR /F %%B in (blacklist.txt)] 3) IF variableA is the same as variableB, delete variableA. [iF /I %%A==%%B DEL %%A] So, you end up with: :: Check search User areas FOR /F %A in ("DIR \\server\share\userdocuments /S /B") DO :: Check against blacklist For /F %B in (CheckFile.txt) DO :: DELETE! IF /I %A==%B DEL %A It may work... I haven't tested it. Edited June 22, 2012 by X-13
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now