Solved

Delete a file out of random directory.

Posted on 2012-04-06
3
719 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 51

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

759 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

21 Experts available now in Live!

Get 1:1 Help Now