Solved

Need permission for Bat file to remove Directories in Program Files

Posted on 2004-10-26
244 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
Question by:Nautical9
    4 Comments
     
    LVL 6

    Expert Comment

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

    Expert Comment

    by:paraghs
    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:
    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
    But it works either way, paraghs has the right answer I think
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Prepare to Pass the CompTIA A+ 900 Series Exam

    CompTIA aims to adapt its A+ Certification to reflect the most current knowledge and skills needed by today's IT professionals--and this year's 2016 exam is harder than ever. This certification is one of the most highly-respected and sought after in IT.

    Suggested Solutions

    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…
    Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
    This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.
    Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    875 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now