First, this is a CMD (command line) question, as the language used to call the CMD is irrelevant to the question in question.
Second, we can not assume that Chrome will be on disk C:
So the right place is %LOCALAPPDATA%
, which already has all the details for the current user folder. This is if Chrome is installed at the default place. Ideally search for the registry.
Simply put, using the logic of the question, the line would have to stay this way:
Shell("CMD.exe /c DEL /q ""%LOCALAPPDATA%\Google\Chrome\User Data\Default\Cache\*.*"" ")
Now, between us, if it is to use VB, it would compensate a procedure in VB even to clean the directory, instead of calling the CMD...
I don’t see the use of del, nor of rmdir/Rd to remove the content in this example. The cd is to change directory and not to delete files.
– ararog
@ararog can help me with an example ?
– Perroni
del C: Users%username% Appdata Local Google Chrome User Data Default Cache\.
– ararog
@ararog like this one I made to run a txt file I’ll send you the code if I put a 1.txt file inside the cache it opens I don’t know how to use the deleted downloaded ? I don’t know how to put it on the line , The command I use to open is like this , Shell("CMD.exe /c ""C: Users"%username%"" Appdata Local Google Chrome"""User Data"" Default Cache 1.txt"" ")
– Perroni
@ararog I will test here , Erai.
– Perroni
@ararog went bad, he did not execute the command, something is wrong on the written line.
– Perroni
@ararog I’ll take the print
– Perroni
@ararog I wrote the code so
– Perroni
@ararog Shell("CMD.exe del C: Users%username% Appdata Local Google Chrome User Data Default Cache*.*") Error image link : http://i.imgur.com/Cbvow7g.png
– Perroni
Instead of %username.
– ararog
@ararog nothing same, gave error again the same image error.
– Perroni