Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need permission for Bat file to remove Directories in Program Files

Posted on 2004-10-26
5
Medium Priority
?
249 Views
Last Modified: 2012-05-05
I have created a bat file that removes Directories, and subdirectories, however... it will not remove directories, and subdirectories from Program Files. How to I give this bat file rights to remove these directories from Program Files. No laughing please... here is the simple bat file I have created. What do I need to do?
Thanks N9
@echo off

Rem Remove PLSNOVATSTxxx folders from Program Files\novadigm*
echo y | rmdir /s /q c:\Program Files\Novadigm\lib\SYSTEM\PLSNOVTST102
echo y | rmdir /s /q c:\Program Files\Novadigm\lib\SYSTEM\PLSNOVTST10
echo y | rmdir /s /q c:\Program Files\Novadigm\lib\SYSTEM\PLSNOVTST101
echo y | rmdir /s /q c:\Program Files\Novadigm\lib\SYSTEM\PLSNOVTST10i
echo y | rmdir /s /q c:\Program Files\Novadigm\lib\SYSTEM\RADIA
echo y | rmdir /s /q c:\Program Files\Novadigm\lib\SYSTEM\RADIA10i
:END
0
Comment
Question by:Nautical9
  • 3
5 Comments
 
LVL 6

Expert Comment

by:nihlcat
ID: 12417719
How about using DELTREE /Y
Or is that not valid anymore? :o
0
 
LVL 9

Expert Comment

by:paraghs
ID: 12417807
Since "Program Files" contains a white space, you need to put the whole string (starting from c:) under quotes ("c:\program files\.....")
0
 
LVL 6

Accepted Solution

by:
nihlcat earned 1400 total points
ID: 12417871
Actually you don't need to quote the whole string.  This should work:

echo y | rmdir /s /q c:\"Program Files"\Novadigm\lib\SYSTEM\PLSNOVTST102
0
 
LVL 6

Expert Comment

by:nihlcat
ID: 12417889
But it works either way, paraghs has the right answer I think
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Aerodynamic noise is the cause of the majority of the noise produced by helicopters. The inordinate amount of noise helicopters produce is a major problem in the both a military and civilian setting. To remedy this problem the use of an aerogel coat…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question