« Previous Next »

Answered Thread: small problem with replace and backslashes

Last post 10-22-2009 3:47 PM by merk. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 10-22-2009, 2:51 PM

    • merk
    • Top 50 Contributor
    • Joined on 09-17-2002, 4:29 PM
    • Pasadena, CA
    • Posts 120

    small problem with replace and backslashes

    have the following when i run msdeploy:

    -replace:objectname=metaproperty,match="c:\\inetpub",replace="d:\\inetpub"

    when I run this, the command runs but in IIS7 i see d:\\inetpub\..... there's an extra backslash

    when i remove the extra backslash from the command, it fails to run since it think's the backslash is a command line switch

    So what is the correct syntax here if on my source server everything is on C drive and on my dest server everything is on D driver? Paths all remain the same within the inetpub folder - just moved it to D drive on the dest server

    thanks
  • 10-22-2009, 3:21 PM In reply to

    Answered Re: small problem with replace and backslashes

    All you have to do is remove the extra slash from the replace string but not from the match string. Since the match string is regex while the replace string is used to replace as is. So the current syntax can be:

    -replace:objectname=metaproperty,match="c:\\inetpub",replace="d:\inetpub"

    Let us know if you need more information.

     

  • 10-22-2009, 3:47 PM In reply to

    • merk
    • Top 50 Contributor
    • Joined on 09-17-2002, 4:29 PM
    • Pasadena, CA
    • Posts 120

    Re: small problem with replace and backslashes

    ah, of course. Thank you!
Page 1 of 1 (3 items)
Microsoft Communities