UNSOLVED

VoiS2

updated

21 years ago

V

VoiS2

1 Rookie

•

481 Posts

0

5658

August 21st, 2005 04:00

help w/renaming "program files" directory (removing space to become "programfiles")

I would like to ask for help in changing the name of the directory "Program Files" to "ProgramFiles" -- without the space.  I use Win XP SP2.
 
I have learned enough to be able to remove the attribute of Read-Only to that directory and all of its many sub-folders, thousands of files and contents.  I've confirmed my success in doing that by using the ATTRIB command in a DOS prompt.  'R' now does not appear in that attributes of that directory and its files, so I think I am good on that.
 
But when I try to change the name from "Program Files" to "ProgramFiles" -- either right-clicking through Explorer, or even when using a folder renamer such as MRename -- my plans get foiled.  It either gives me an Access Denied error (using MRename) or the right-click quick menu doesn't offer me the option to rename. :-(
 
Any assistance?  The goal here is to be able to make a batch file that involves that directory, and in order for a .bat file to invoke that directory path, there must be no spaces in the name.  Thanks very much!!!! 
  • volcano11

    2 Intern

    •

    27973 Posts

    359

    0

    Posted August 21st, 2005 05:00

    Since the Program Files folder is a protected operating system folder, I seriously doubt that Windows will allow you to change its name.  The solution is to create a ProgramFiles folder, uninstall all of your programs, then reinstall them directing Windows to install the programs in the this newly created folder.

    Steve

  • rj1127

    141 Posts

    359

    0

    Posted August 21st, 2005 07:00



    @VoiS2 wrote:
    Any assistance?  The goal here is to be able to make a batch file that involves that directory, and in order for a .bat file to invoke that directory path, there must be no spaces in the name.  Thanks very much!!!! 


    Renaming Program Files folder is a bad idea. Not sure what your batch file does but have you tried using "progra~1" (without double quotes)? Progra~1 will give you access to Program Files folder provided that you don't have anything with similar name, eg: Programs File (I move the s). If you do, you'll have progra~2, progra~3 and so on if you have many folders that start with "program  ".

    You may also try using "program files" (with double quotes) in your batch file.

    Message Edited by rj1127 on 08-21-2005 03:18 AM

  • msgale

    2 Intern

    •

    2507 Posts

    359

    0

    Posted August 21st, 2005 09:00

    1 -  Don't do it.  and,  2 - You don't need  to do it.  3 - here is a bat file that uses program files (with the space).
     
    cd "\Program Files"
    dir
     
    I tried it and it works, note program files (with the space) is in a quotes string.
     
     
  • redwolfe_98

    2 Intern

    •

    1326 Posts

    359

    0

    Posted August 21st, 2005 15:00

    if you did manage to rename the folder, then you would no longer have the correct "paths" to anything that is in the folder, so then none of the programs in the folder would run..
     
    it is good that windows would not allow you to rename the folder..
  • VoiS2

    1 Rookie

    •

    481 Posts

    359

    0

    Posted August 21st, 2005 17:00

    The constructive information I was looking for was the explanation in red color above.
    Thanks, and that gets around the batch file problems.  (Using the quotation marks, that is.)