+ Post New Thread
Results 1 to 2 of 2
Scripts Thread, batch file to remove swf games in Coding and Web Development; I have created a batchfile that removes listed swf games, eg.. del "%Folder%d-missile.swf" /S /F /Q >> %TextFile% then just ...
  1. #1

    Join Date
    Nov 2011
    Thank Post
    Thanked 27 Times in 26 Posts
    Rep Power

    batch file to remove swf games

    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

  2. #2

    X-13's Avatar
    Join Date
    Jan 2011
    Thank Post
    Thanked 1,990 Times in 1,370 Posts
    Blog Entries
    Rep Power
    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.
    Last edited by X-13; 22nd June 2012 at 11:11 AM.

+ Post New Thread

Similar Threads

  1. Batch file to copy user profile
    By googlemad in forum Windows
    Replies: 2
    Last Post: 15th October 2010, 11:08 PM
  2. Getting a batch file to react to a registry key
    By Wheelgunr in forum Windows
    Replies: 5
    Last Post: 12th September 2008, 05:23 PM
  3. Batch file to remove registry key doesnt work
    By sidewinder in forum Windows
    Replies: 4
    Last Post: 7th December 2007, 04:48 PM
  4. batch file to shutdown PCs
    By macca in forum Windows
    Replies: 5
    Last Post: 3rd May 2007, 09:20 AM
  5. prezzie batch file to collect dps logs
    By russdev in forum ICT KS3 SATS Tests
    Replies: 4
    Last Post: 16th May 2006, 12:16 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts