Welcome to Vista Banter. You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to ask questions and reply to others posts, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact support. |
|
Windows Vista File Management Issues or questions in relation to Vista's file management. (microsoft.public.windows.vista.file_management) |
|
LinkBack | Thread Tools | Display Modes |
|
|||
"del /s foo*" doesn't work
What's the command-line command to recursively delete all files and
directories with names beginning with "foo"? "del /s foo*" doesn't work. Doing it using the GUI, with Start/Search and searching for "name:foo" and then selecting all and choosing "delete", doesn't work, because I have hundreds of such directories, and for each one Vista will grind away on my disk for a couple minutes and then give me a bogus "This folder is shared with other people--If you delete this folder, it will no longer be shared.--Continue or Cancel" message and make me press "Continue" before it will grind away for another couple minutes and give me another bogus message for the next folder, and there's no "Yes to All" button, so I have to sit for hours babysitting the machine and pressing "Continue" over and over in order to delete all the directories. So until MS fixes that bug, I need to do it from the command line. So what's the command to do it? |
|
|||
"del /s foo*" doesn't work
Did you try doing this while running the command prompt as Administrator?
-- Dave "Roof Fiddler" wrote in message ... What's the command-line command to recursively delete all files and directories with names beginning with "foo"? "del /s foo*" doesn't work. Doing it using the GUI, with Start/Search and searching for "name:foo" and then selecting all and choosing "delete", doesn't work, because I have hundreds of such directories, and for each one Vista will grind away on my disk for a couple minutes and then give me a bogus "This folder is shared with other people--If you delete this folder, it will no longer be shared.--Continue or Cancel" message and make me press "Continue" before it will grind away for another couple minutes and give me another bogus message for the next folder, and there's no "Yes to All" button, so I have to sit for hours babysitting the machine and pressing "Continue" over and over in order to delete all the directories. So until MS fixes that bug, I need to do it from the command line. So what's the command to do it? |
|
|||
"del /s foo*" doesn't work
"DMB" wrote in message
... Did you try doing this while running the command prompt as Administrator? That shouldn't be necessary, since the logged-in user owns the files and folders in question. |
|
|||
"del /s foo*" doesn't work
You're right it shouldn't be necessary but did you try it? Vista is still a
beta and may have bugs. Running an elevated cmd prompt is a valid test to see if there are some permissions issues or maybe a bug. -- Kerry MS-MVP Windows - Shell/User http://www.vistahelp.ca Roof Fiddler wrote: "DMB" wrote in message ... Did you try doing this while running the command prompt as Administrator? That shouldn't be necessary, since the logged-in user owns the files and folders in question. |
|
|||
"del /s foo*" doesn't work
I tried this on my system and it worked fine. Can you give more information
as to what files you are trying to delete and what response you are getting from the command prompt? -- - JB Windows Vista Support Faq http://www.jimmah.com/vista/ |
|
|||
"del /s foo*" doesn't work
"Jimmy Brush" wrote in message
... I tried this on my system and it worked fine. Can you give more information as to what files you are trying to delete and what response you are getting from the command prompt? I open cmd.exe as administrator, and: C:\Windows\system32mkdir foo C:\Windows\system32mkdir foo\bar C:\Windows\system32mkdir foo\bar\baz C:\Windows\system32dir /s bar [snip] Directory of C:\Windows\system32\foo 11/01/2006 10:05 AM DIR bar 0 File(s) 0 bytes [snip] C:\Windows\system32dir /s baz [snip] Directory of C:\Windows\system32\foo\bar 11/01/2006 10:06 AM DIR baz 0 File(s) 0 bytes [snip] C:\Windows\system32del /s bar C:\Windows\system32dir /s bar [snip] Directory of C:\Windows\system32\foo 11/01/2006 10:05 AM DIR bar 0 File(s) 0 bytes [snip] C:\Windows\system32 C:\Windows\system32dir /s baz [snip] Directory of C:\Windows\system32\foo\bar 11/01/2006 10:06 AM DIR baz 0 File(s) 0 bytes [snip] So, even though "del /s bar" returns no error message, neither bar nor its contents (baz) are actually deleted. Yes, I know how to actually get rid of bar and baz in this case. The problem is that I might have many directories named "bar" scattered throughout various other subdirectories of my current directory, and I need a single command which, when run from my current directory, will delete all of them and their contents. |
|
|||
"del /s foo*" doesn't work
"Roof Fiddler" wrote: So, even though "del /s bar" returns no error message, neither bar nor its contents (baz) are actually deleted. This is driving me crazy too. I have the exact same problem in both Vista AND XP and really need an answer from someone smarter than me... What's most frustrating is that the del command help states "Wildcards may be used to delete multiple files. If a directory is specified, all files within the directory will be deleted." But it simply doesn't happen. The best I have come up with so far is to copy DELTREE command into the system and use the following batch file to creates a list of the directories you want to delete: cd %1 dir /s BAR /a /b /-p /o:GEN "C:\Documents and Settings\%USERNAME%\Local Settings\Temp\dirlist.txt" copy "C:\Documents and Settings\%USERNAME%\Local Settings\Temp\dirlist.txt" %1 del "C:\Documents and Settings\%USERNAME%\Local Settings\Temp\dirlist.txt" and then turn that "dirlist.txt" into a .bat file with the 'deltree' command in front of each line in quotes. Run it and voila! (Very oldschool, but at least it works.) |