Solved

Trying to rename a folder with the REN command but nothing I try works

Posted on 2006-06-29
12
625 Views
Last Modified: 2007-12-19
Trying to rename a folder with an NT command (CMD script) like so:

----------------------------------------------------------------------------------------------------
REN "%ALLUSERSPROFILE%\Start Menu\Programs\Administrative Tools" "Admin Tools"
----------------------------------------------------------------------------------------------------

It will not work!

This does not work either:

----------------------------------------------------------------------------------------
REN %ALLUSERSPROFILE%\START~1\PROGRA~1\ADMINI~1 "Admin Tools"
----------------------------------------------------------------------------------------

Putting a \ after the path does not work.

Its just a normal directory, it has a greyed out read only
attribute on the directory, but not on any of the files inside
the directory and it is not protected in any way.

I guess I need some switch(es)?
0
Comment
Question by:EE33
12 Comments
 
LVL 37

Expert Comment

by:Harisha M G
ID: 17014987
Hi, if you goto the command prompt, and to the folder Start Menu, and them type

REN "Administrative Tools" "Admin Tools"

Does it give any error ?

---
Harish
0
 
LVL 51

Expert Comment

by:Netman66
ID: 17014989
It won't run under the context of the user because they don't have the rights to rename it.

It should work fine if you are part of the local Admin group.

Try to run it manually from the CMD window as admin.

0
 
LVL 3

Author Comment

by:EE33
ID: 17015048
@ mgh_mgharish - Yes I get "The system cannot find the file specified"

What what! "file" ???

@ Netman66 - It is logged in as an Administrator

Thanks for the instant answers!
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 3

Author Comment

by:EE33
ID: 17015056
"The system cannot find the file specified"

This is why I tried:

REN "%ALLUSERSPROFILE%\Start Menu\Programs\Administrative Tools\" "Admin Tools"

and

REN %ALLUSERSPROFILE%\START~1\PROGRA~1\ADMINI~1\ "Admin Tools"

With backslashes at the enf of the path but, no go.
0
 
LVL 37

Expert Comment

by:Harisha M G
ID: 17015066
0
 
LVL 37

Expert Comment

by:Harisha M G
ID: 17015075
OOPS.. sorry.. that was for another question

What happens if you goto the Start Menu directory and then rename ? (Not from the batch file.. manually)
0
 
LVL 3

Author Comment

by:EE33
ID: 17015094
Theres more than one way to skin a cat, im not skinning a cat
but, this is an unattended install... so I can just put a replacement
"Admin Tools" in [$OEM$\$Docs\All Users\Start Menu\Programs]
and use the DEL command to delete the original directory, since
it will DEL the directory no problem, whicj is typical of Windows
I guess, sheesh.

Thanks for the help, but I am going to try a different way, how
does it work with the points since I don't need an answer? Oops!
0
 
LVL 37

Expert Comment

by:Harisha M G
ID: 17015115
What I meant was not to do it manually, but to see whether it works or not.

If it gives error, then the error is in the folder access itself, not in your batch script
0
 
LVL 3

Author Comment

by:EE33
ID: 17015182
Yes, it will delete manually.

After all the things I tried now in the Recycle Bin it is called "Admin Tools"
so I restored it, its called "Administrative Tools" when its restored to the
Start Menu!

You normally get a message saying "This will affect all users who log onto this computer"
when deleting stuff off the start menu but I did not get that message, hmmmmm, I have
a new problem now - I cannot remove the directory with a script....

This won't do it....

-------------------------------------------------------------------------------------------
RD /S /Q "%ALLUSERSPROFILE%\Start Menu\Programs\Administrative Tools\"
-------------------------------------------------------------------------------------------

Neither will this....

-------------------------------------------------------------------------------
RD /S /Q "%ALLUSERSPROFILE%\START~1\PROGRAMS\ADMINI~1\"
-------------------------------------------------------------------------------

This won't do it...

-------------------------------------------------------------------------------
RD /S /Q %ALLUSERSPROFILE%\START~1\PROGRA~1\ADMINI~1\
-------------------------------------------------------------------------------

or this

-------------------------------------------------------------------------------
RD /S /Q "%ALLUSERSPROFILE%\START~1\PROGRAMS\ADMINI~1"
-------------------------------------------------------------------------------

0
 
LVL 3

Author Comment

by:EE33
ID: 17015673
Its a protected operating system folder and cannot be changed!

OK I give up.
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 17200373
PAQed with points refunded (500)

DarthMod
Community Support Moderator
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What is this Task? 4 147
RAID / SATA Drivers for Intel Server Board SE7525GP2 and SE7320SP2 4 109
How to install a font on WIN2003SBS/IIS 6 & test 17 47
BgInfo help 5 54
by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

679 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