[Resolved] Renaming system files
I'm having a slight problem and i think it's due to Command Prompt. I'm trying to rename a system directory. It works on normal directories but not windows system dirs. I'm trying to do this the easitest way possible:
Code:
Private Sub cF_Click()
On Error Resume Next
Dim command1 As String
command1 = "rename %homedrive%\RECYCLER RecyclebinBACKUP"
Shell "Cmd.exe /k" & command1, vbNormalFocus
End Sub
Any way around this?
Re: Renaming system files
Why do you need to rename windows system file(s)?
Re: Renaming system files
It looks to me that he is trying to create a backup of the recycle bin.
Re: Renaming system files
But its being renamed not copied?
Re: Renaming system files
You have to remove the hidden and system attribute of the folder before you can rename it. You should also add a space after the "/k" part of your string...
Re: Renaming system files
The reason i'm renaming the recycle bin is because if you rename "recycler" Windows creates a new recycle bin which solves about 80% of recycle bin problems.
Re: Renaming system files
Sorry if I sound "mean" or anything like that, but..
Why would you need to write a program to do it for you? Can't you just go into windows explorer and rename it?
Re: Renaming system files
Quote:
Originally Posted by Narfy
Sorry if I sound "mean" or anything like that, but..
Why would you need to write a program to do it for you? Can't you just go into windows explorer and rename it?
This is what I was getting at. Besides, how often do you really have Recycle Bin troubles?
I never have in way too many years to mention.
Re: Renaming system files
Quote:
Originally Posted by RobDog888
This is what I was getting at. Besides, how often do you really have Recycle Bin troubles?
I never have in way too many years to mention.
No but renaming the recycle bin would then solve 80% of the none problems you have... :) Actually I've never heard that renaming the recycle bin would fix any problem, but if it does it does. And if it does I can understand why one would put that in a program, if it's a part of a larger program that analyzes and fix many known issues with Windows.
Re: Renaming system files
But he could use the LineTo API function. But that would also require him to create a pen and select it into the hDC and then call MoveToEx before using the LineTo function. However I don't think he fully understands the code he's using already and introducing all GDI functions at once might not be the best idea :).
Re: Renaming system files
It's not for me lol, i solved it anyway just used SetAttr ("C:\RECYCLER"), vbNormal and everything wokred fine. Thanks anyway
Re: Renaming system files
Quote:
Originally Posted by BefunMunkToloGen
It's not for me lol, i solved it anyway just used SetAttr ("C:\RECYCLER"), vbNormal and everything wokred fine. Thanks anyway
You mean exactly as I suggested...?
Quote:
Originally Posted by Joacim Andersson
You have to remove the hidden and system attribute of the folder before you can rename it.