Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Delete a file out of random directory.

Posted on 2012-04-06
3
Medium Priority
?
728 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 2000 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 59

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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

772 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