Solved

Delete a file out of random directory.

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 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