Solved

Delete a file out of random directory.

Posted on 2012-04-06
3
720 Views
Last Modified: 2012-04-06
I have a need to delete a file called pluginreg.dat that is placed in a randomly named directory by Mozilla. It is located in the following location, where * is the randomly named directory.

"%USERPROFILE%\AppData\Roaming\Mozilla\Firefox\Profiles\*.default"

Courtesy of BillPrew he helped me accomplish some other tasks within this directory and I would like to build off of his script:

@echo off
for /D %%A in ("%USERPROFILE%\AppData\Roaming\Mozilla\Firefox\Profiles\*.default") do (
  xcopy "\\domain\netlogon\blocklist.xml" "%%~A"
  echo user_pref^("extensions.blocklist.url", "127.0.0.1"^); >>"%%~A\prefs.js"
)

Open in new window


I did try to accomplish this on my own but was not successful by adding this line inside the brackets:

echo del "%%~A\pluginreg.dat"

Open in new window


Any help would be appreciated.
0
Comment
Question by:swhitti
3 Comments
 
LVL 12

Accepted Solution

by:
FarWest earned 500 total points
ID: 37817740
why not using del /s
it should work with you
0
 

Author Closing Comment

by:swhitti
ID: 37817768
Worked great! Thanks for the tweak....
0
 
LVL 52

Expert Comment

by:Bill Prew
ID: 37817910
This would also work:
@echo off
for /D %%A in ("%USERPROFILE%\AppData\Roaming\Mozilla\Firefox\Profiles\*.default") do (
  xcopy "\\domain\netlogon\blocklist.xml" "%%~A"
  echo user_pref^("extensions.blocklist.url", "127.0.0.1"^); >>"%%~A\prefs.js"
  del "%%~A\pluginreg.dat"
)

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need to learn promise API 2 43
copy-item script help 15 66
batch file problem 5 19
Check folder every for files and print them 5 17
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now