Windows Server 2008 R2 Thread, Deleting Files - "File Not Found" even though it is there in Technical; I'm trying to run a batch script to delete a particular file from everyone's profile - when I run it, ...
-
17th October 2011, 12:37 PM #1 Deleting Files - "File Not Found" even though it is there
I'm trying to run a batch script to delete a particular file from everyone's profile - when I run it, it returns the message that it couldn't find the file, even though it is definitely there. I'm wondering if this is because the file is inside a hidden directory. How can I script the deletion of these files?
-
-
IDG Tech News
-
17th October 2011, 12:41 PM #2 That will be the reason but there is a way round it
Should do it
-
-
17th October 2011, 12:41 PM #3 
Originally Posted by
enjay
I'm trying to run a batch script to delete a particular file from everyone's profile - when I run it, it returns the message that it couldn't find the file, even though it is definitely there. I'm wondering if this is because the file is inside a hidden directory. How can I script the deletion of these files?
First thing I'd do is dump the file paths to the command line to check you haven't missed out any slashes... that's caught me out a few times and made me feel rather dumb!
-
-
17th October 2011, 03:01 PM #4 The /a:h doesn't work, and the path is definitely good - I've copied it from the batch file and pasted it into Explorer, and it resolves.
-
-
17th October 2011, 03:39 PM #5 Am I right in thinking you want to delete all files in a hidden folder? Take a look at this page
Del - Delete Files
In particular the following lines
Folders
If a folder name is given instead of a file, all files in the folder will be deleted, but the folder itself will not be removed.
-
-
17th October 2011, 04:19 PM #6 No, I want to delete a single (non-hidden) file in a hidden folder. Being specific, it is \\[server]\[user]\AppData\Microsoft\Templates\normal.dot which I want to delete, and the AppData folder is the hidden one.
My batch file reads:
del /q /a:h D:\\Users\Staff\[name]\appdata\Microsoft\Templates\normal.dot
I suppose I could try DEL /F /S /Q %normal.dot% instead, kind of like being able to test these sort of commands first though...
-
SHARE: 
Similar Threads
-
By enjay in forum Home Access Plus+
Replies: 7
Last Post: 27th September 2011, 04:08 PM
-
By xoAlto in forum Windows
Replies: 0
Last Post: 1st December 2009, 12:17 PM
-
Replies: 22
Last Post: 19th March 2008, 09:56 AM
-
By e_g_r in forum Windows
Replies: 4
Last Post: 9th January 2007, 04:03 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules