Menu

Hyphens and the sStorage variable

Help
jas
2008-04-30
2013-04-05
  • jas

    jas - 2008-04-30

    Hi,

    My scenario is I  am backing up VMs to a UNC path. Unfortunately many of my machines have hyphens in their names e.g. wkstn-dev-23. If the sStorage variable and/or the sArchive variable has a path with hyphens in it they don't work.

    Does the hyphen need to be escaped somehow? As you can tell I'm not a scripter......

    Regards,
    JAS.

     
    • karsten Steen

      karsten Steen - 2008-09-30

      Good question. I am looking for some way to solve this question myself.

      JAS have you found out how to solve this problem?

       
      • jas

        jas - 2008-09-30

        Hi,

        The workaround I use is to use a batch file to initiate the backup script.
        This mounts the destination share as the R: drive. Then runs the backup script, then dismounts the R: drive. Just change the xxx.xxx.xxx.xxx bit to your destination IP address ;)

        Batch File:
        ==========================Start file=========================

        net use R: /delete

        net use R: \\xxx.xxx.xxx.xxx\FolderName

        E:
        cd \VS_Backup
        cscript "E:\VS_Backup\VirtualServerBackup 1.0.4.vbs"

        net use R: /delete

        ==========================End File===========================

        Corresponding entry in backup vbs file:

        =========================Start extract=======================

        sArchive = "R:"
        sFileLog = ""
        sMountDrive = "S:"   
        sStorage = "R:\Log"

        ==========================End extract========================

        This is not an elegant solution, but it works for me.

        Regards,
        JAS.

         

Log in to post a comment.