How to delete a file without extension by SHELL

Asked

Viewed 867 times

-1

In visual basic I use this command and I can delete all the files inside the cache folder of google Chrome as in the example below :

Shell("CMD.exe /c DEL /q"%LOCALAPPDATA% Google Chrome User Data Default Cache*.*"" ")

[[ But what I want to delete is inside that folder. %LOCALAPPDATA% Google Chrome User Data Default is the file called simply history without extension with nothing ; if anyone can help I thank . ]] Has a print URL to exemplify

To make it easier I took a print http://i.imgur.com/Kip7tis.png

Thank you to all who can help .

Thus deletes normal My.Computer.Filesystem.Deletefile("C: Users Mauricio Perroni Appdata Local Google Chrome User Data Default History") * Works only deleta on my user not for everyone.

But only gives on my pc ; because it is with my user if I put %USERNAME% which is the variable of my user it does not execute the command .

  • @Bacco knows the answer to that ?

  • Try: Shell("CMD.exe /c DEL /q ""%LOCALAPPDATA%\Google\Chrome\User Data\Default\Cache*"" ")

  • @Viníciusgobboa.deOliveira is not the cache I want to delete is not the History file that is inside the DEFAULT folder. I used cache to give example .

  • @Wineusgobboa.deOliveira business that the file has no extension so it thinks that the command is a folder . serves if I put Shell("CMD.exe /c DEL "%"LOCALAPPDATA% Google Chrome User Data Default History.rar"" ") it deletes the file because it has extension if not delete because it has no extension .

  • First you have to make sure that the file is not being used, otherwise it will not delete even. You may have to run 2x the command, once with * and once with *.* (test and see what happens). I still think a VB loop would make a better service than calling the shell.

  • @Bacco he is not deleting because he understands that History is a folder and not a file without extension what he is .

  • @Perroni has no sense this, the OS does not have these crises of consciousness. Folder is folder, file is file. Either the application does not have permission on the file, or it is in use. See here as del with a * only works well to delete files without extension, I just ran a test: http://i.stack.Imgur.com/Mcrer.png (the yellow ones I marked manually, with the capture tool Snipping Tool windows 7) Tip: i put a COM file extension and tested again, the * served to erase all, with and without extension, probably in your case can change the *.* for *.

  • @Bacco has teamviewer there ?

  • @Bacco wanted to show you, it would be simpler. When I use this command below: My.Computer.Filesystem.Deletefile("C: Users Mauricio Perroni Appdata Local Google Chrome User Data Default History") &#Xa the problem with the working command is that I have to take my name off the line and put %USERNAME% there when I put Vb does not accept the system variable.

  • @Bacco I’ll find a way to make a video here .

  • @Perroni there is another problem, simply missing you take the variable %localappdata% by another means, because Deletefile does not do the automatic expansion. Just vc first take the environment variables in VB itself, and write like this: My.Computer.FileSystem.DeleteFile( meuLocalAppData + "\Google\Chrome\User Data\Default\History")

  • @Bacco I already know I will activate twitchTV ; Perai.

  • @Bacco you facebook ?

  • @Bacco ?: you can see me at this link ? http://www.twitch.tv/icedoxforce

  • @Bacco solved ; * your command solved my problem . you answered in another topic but it’s all right. Shell("CMD.exe /c DEL /q"%LOCALAPPDATA% Google Chrome User Data Default History"" ")

  • @Perroni I answered there, because it is part of the same doubt, otherwise it sees a lot of mess on the site. I think you could even delete this one (the remove is just below the question), because it’s all there. Too bad you didn’t understand what the mustache meant in that post, because it was to help you to use the Site better. Well, the important thing is that you solved. Look for the next questions to look at the details of how the site works, because it is to your own advantage, and faster to get good answers.

  • @Bacco can’t find the delete button.

  • @Perroni with posted answer can not delete, would have to delete the answer before.

Show 13 more comments

1 answer

-2

Shell("CMD.exe /c DEL /q ""%LOCALAPPDATA%\Google\Chrome\User Data\Default\History"" ") 

@Bacco , answer given by him in another topic .

Browser other questions tagged

You are not signed in. Login or sign up in order to post.