|
-
Mar 24th, 2005, 05:27 PM
#1
Thread Starter
Lively Member
[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?
Last edited by BefunMunkToloGen; Mar 25th, 2005 at 03:18 PM.
-
Mar 24th, 2005, 05:37 PM
#2
Re: Renaming system files
Why do you need to rename windows system file(s)?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 24th, 2005, 05:40 PM
#3
Hyperactive Member
Re: Renaming system files
It looks to me that he is trying to create a backup of the recycle bin.
-
Mar 24th, 2005, 05:44 PM
#4
Re: Renaming system files
But its being renamed not copied?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 24th, 2005, 06:28 PM
#5
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...
-
Mar 24th, 2005, 09:18 PM
#6
Thread Starter
Lively Member
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.
-
Mar 24th, 2005, 09:34 PM
#7
Hyperactive Member
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?
-
Mar 24th, 2005, 10:15 PM
#8
Re: Renaming system files
 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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 24th, 2005, 10:34 PM
#9
Re: Renaming system files
 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.
-
Mar 24th, 2005, 10:40 PM
#10
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 .
-
Mar 25th, 2005, 03:18 PM
#11
Thread Starter
Lively Member
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
-
Mar 26th, 2005, 12:27 PM
#12
Re: Renaming system files
 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...?
 Originally Posted by Joacim Andersson
You have to remove the hidden and system attribute of the folder before you can rename it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|