Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Generic User Avatar

Deletion of JSON* files by batch file


  • Please log in to reply
6 replies to this topic

#1 Bastie

Bastie

  •  Avatar image
  • Members
  • 229 posts
  • OFFLINE
  •  
  • Local time:11:22 AM

Posted 27 August 2023 - 07:31 AM

Why does a batch file saying

'del C:\Data\Firefox\Bookmarks\ /q'

not delete the JSON* files from \bookmarks\ ?
or
What batchfile code will delete JSON* files from \bookmarks\ ?



BC AdBot (Login to Remove)

 


#2 pseymour

pseymour

  •  Avatar image
  • Members
  • 186 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Ohio, USA
  • Local time:09:22 PM

Posted 27 August 2023 - 02:38 PM

The command you gave would just delete all files in that folder you specified, and not in subfolders.

 

To remove files with .json extension, you would do

del /q "C:\Data\Firefox\Bookmarks\*.json"

If you wanted to remove them from subfolders also

del /q /s "C:\Data\Firefox\Bookmarks\*.json"

Edited by pseymour, 27 August 2023 - 02:38 PM.

-- Patrick


#3 Bastie

Bastie
  • Topic Starter

  •  Avatar image
  • Members
  • 229 posts
  • OFFLINE
  •  
  • Local time:11:22 AM

Posted 11 September 2023 - 12:50 PM

You code differs from mine by only the position of '/q' - which you have after 'del' and I had at the end of the line.

 

In a week's time, I will report on the effectiveness of relocating '/q'.



#4 pseymour

pseymour

  •  Avatar image
  • Members
  • 186 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Ohio, USA
  • Local time:09:22 PM

Posted 11 September 2023 - 07:28 PM

It differs by more than that. I also explained what your command does.


-- Patrick


#5 Bastie

Bastie
  • Topic Starter

  •  Avatar image
  • Members
  • 229 posts
  • OFFLINE
  •  
  • Local time:11:22 AM

Posted 18 September 2023 - 08:23 PM

The question of subfolders does not arise - all the files I want deleted are in just C:\Data\Firefox\Bookmarks\.

 

If you are referring to '*.jsonlz4' as another difference, I apologize for not recognizing that.

I misrepresented the code in my batch file - that did include '*.jsonlz4'

 

Relocating the '/q' has caused no improvement.



#6 pseymour

pseymour

  •  Avatar image
  • Members
  • 186 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Ohio, USA
  • Local time:09:22 PM

Posted 19 September 2023 - 07:46 AM

Relocating the /q would make no difference; I never said it did. Also, now you've specified jsonlz4, which would have been helpful before.

 

Are you getting any kind of error message?


Edited by pseymour, 19 September 2023 - 07:46 AM.

-- Patrick


#7 Bastie

Bastie
  • Topic Starter

  •  Avatar image
  • Members
  • 229 posts
  • OFFLINE
  •  
  • Local time:11:22 AM

Posted Today, 01:49 AM

I apologize for the wild goose chase - I misread the symptoms; my own efforts at deletion were successful but misunderstood.






4 user(s) are reading this topic

0 members, 4 guests, 0 anonymous users