EE33
asked on
Trying to rename a folder with the REN command but nothing I try works
Trying to rename a folder with an NT command (CMD script) like so:
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----
REN "%ALLUSERSPROFILE%\Start Menu\Programs\Administrati ve Tools" "Admin Tools"
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----
It will not work!
This does not work either:
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- --
REN %ALLUSERSPROFILE%\START~1\ PROGRA~1\A DMINI~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)?
--------------------------
REN "%ALLUSERSPROFILE%\Start Menu\Programs\Administrati
--------------------------
It will not work!
This does not work either:
--------------------------
REN %ALLUSERSPROFILE%\START~1\
--------------------------
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)?
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.
It should work fine if you are part of the local Admin group.
Try to run it manually from the CMD window as admin.
ASKER
@ 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!
What what! "file" ???
@ Netman66 - It is logged in as an Administrator
Thanks for the instant answers!
ASKER
"The system cannot find the file specified"
This is why I tried:
REN "%ALLUSERSPROFILE%\Start Menu\Programs\Administrati ve Tools\" "Admin Tools"
and
REN %ALLUSERSPROFILE%\START~1\ PROGRA~1\A DMINI~1\ "Admin Tools"
With backslashes at the enf of the path but, no go.
This is why I tried:
REN "%ALLUSERSPROFILE%\Start Menu\Programs\Administrati
and
REN %ALLUSERSPROFILE%\START~1\
With backslashes at the enf of the path but, no go.
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)
What happens if you goto the Start Menu directory and then rename ? (Not from the batch file.. manually)
ASKER
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!
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!
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
If it gives error, then the error is in the folder access itself, not in your batch script
ASKER
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\Administrati ve 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\A DMINI~1\
-------------------------- ---------- ---------- ---------- ---------- ---------- ---
or this
-------------------------- ---------- ---------- ---------- ---------- ---------- ---
RD /S /Q "%ALLUSERSPROFILE%\START~1 \PROGRAMS\ ADMINI~1"
-------------------------- ---------- ---------- ---------- ---------- ---------- ---
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\Administrati
--------------------------
Neither will this....
--------------------------
RD /S /Q "%ALLUSERSPROFILE%\START~1
--------------------------
This won't do it...
--------------------------
RD /S /Q %ALLUSERSPROFILE%\START~1\
--------------------------
or this
--------------------------
RD /S /Q "%ALLUSERSPROFILE%\START~1
--------------------------
ASKER
Its a protected operating system folder and cannot be changed!
OK I give up.
OK I give up.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
REN "Administrative Tools" "Admin Tools"
Does it give any error ?
---
Harish