Results 1 to 12 of 12

Thread: [Resolved] Renaming system files

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    107

    [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.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  3. #3
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Utah
    Posts
    397

    Re: Renaming system files

    It looks to me that he is trying to create a backup of the recycle bin.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  5. #5
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    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...

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    107

    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.

  7. #7
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Utah
    Posts
    397

    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?

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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.
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  9. #9
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    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.

  10. #10
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    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 .

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    107

    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

  12. #12
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width