Windows Vista Forums

copy registry key with an embedded colon
  1. #1


    Dan Holmes Guest

    copy registry key with an embedded colon

    i am trying to copy a registry key and all its descends to a new key. The problem is that the key has a colon ( in it.



    PS HKLM:\software\RouteMatch\agencies> copy -literalpath 'rm_pa_septa:SEPTA' 'RM_PA_SEPTA_73479:SEPTA' -recurse
    Copy-Item : Cannot find drive. A drive with the name 'RM_PA_SEPTA_73479' does not exist.
    At line:1 char:5
    + copy <<<< -literalpath 'rm_pa_septa:SEPTA' 'RM_PA_SEPTA_73479:SEPTA' -recurse
    + CategoryInfo : ObjectNotFound: (RM_PA_SEPTA_73479:String) [Copy-Item], DriveNotFoundException
    + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.CopyItemCommand

    How do i keep the colon from being interpreted?

    danny

      My System SpecsSystem Spec

  2. #2


    Dan Holmes Guest

    Re: copy registry key with an embedded colon

    On 12/16/2009 2:25 PM, Dan Holmes wrote:

    > i am trying to copy a registry key and all its descends to a new key.
    > The problem is that the key has a colon ( in it.
    >
    > PS HKLM:\software\RouteMatch\agencies> copy -literalpath
    > 'rm_pa_septa:SEPTA' 'RM_PA_SEPTA_73479:SEPTA' -recurse
    > Copy-Item : Cannot find drive. A drive with the name 'RM_PA_SEPTA_73479'
    > does not exist.
    > At line:1 char:5
    > + copy <<<< -literalpath 'rm_pa_septa:SEPTA' 'RM_PA_SEPTA_73479:SEPTA'
    > -recurse
    > + CategoryInfo : ObjectNotFound: (RM_PA_SEPTA_73479:String) [Copy-Item],
    > DriveNotFoundException
    > + FullyQualifiedErrorId :
    > DriveNotFound,Microsoft.PowerShell.Commands.CopyItemCommand
    >
    > How do i keep the colon from being interpreted?
    >
    > danny
    this does it.

    PS HKLM:\software\RouteMatch\agencies> copy -literalpath .\"rm_pa_septa:SEPTA" .\"RM_PA_SEPTA_73479:SEPTA" -recurse

    note the .\ before the key names.

      My System SpecsSystem Spec

copy registry key with an embedded colon problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Solved Can I save a copy of my registry to...... staybolt General Discussion 6 28 Nov 2009
Copy a binary registry value to another value. Oldguard VB Script 3 03 Sep 2009
Wise Registry Cleaner vs AusLogics Registry Defrag vs CCLeaner? Coderedpl Vista performance & maintenance 7 29 Sep 2008
Re: Using a colon in a script to call another cmdlet Keith Hill [MVP] PowerShell 0 29 Apr 2008
Copy-Item or Copy-ItemProperty and Remote Registry. Brandon Shell PowerShell 1 09 Jan 2007