Solved

Delete a file out of random directory.

Posted on 2012-04-06
3
721 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 53

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

809 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