robocopy returns Invalid Parameters












0















I have written a batch file, the aim of the file is to stop vm, take a back up (Copy the entire Virtualbox VMs) folder to a different drive, start VMs.



Code is as below:



@echo on
cls
echo "Change directory to Virtualbox root directory"

cd /d "c:Program FilesOracleVirtualBox"

echo "Powering off Virtual machines"

VBoxManage controlvm "centos74.master" poweroff
PING localhost -n 30 >NUL

VBoxManage controlvm "centos74.agent" poweroff
PING localhost -n 30 >NUL

echo "Commence backup work"

cd /d E:
if not exist Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2% mkdir Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%
REM cd Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%
robocopy C:UsersuserVirtualBox VMs E:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%

echo "Change directory to Virtualbox root directory"

cd /d "c:Program FilesOracleVirtualBox"

echo "Starting Virtual machines"

VBoxManage startvm "centos74.master"

PING localhost -n 30 >NUL

VBoxManage startvm "centos74.agent"

PING localhost -n 30 >NUL

@echo off


I however have two issues.
1. robocopy in itself doesn't work, please find below execution error message



-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------

Started : Tuesday, 20 November 2018 9:19:03 AM
Source - C:UsersuserVirtualBox
Dest - E:VMs

Files :
Options : /DCOPY:DA /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------

ERROR : Invalid Parameter #3 : "E:Backup-2018-11-20"

Simple Usage :: ROBOCOPY source destination /MIR

source :: Source Directory (drive:path or \serversharepath).
destination :: Destination Dir (drive:path or \serversharepath).
/MIR :: Mirror a complete directory tree.

For more usage information run ROBOCOPY /?


**** /MIR can DELETE files as well as copy them !




  1. Not so important but still the below code is ineffective, meaning it should only create one and only folder even if you execute multiple times. When I execute multiple times it creates nested folder like



    E:Backup-20-Nov-2018Backup-20-Nov-2018Backup-20-Nov-2018




Buggy code:



if not exist Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2% mkdir Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%


Any assistance will be greatly appreciated.










share|improve this question























  • There is a space in the path `C:UsersuserVirtualBox VMs` so you have to double quote it (you should do that for all path variables possibly containing spaces)

    – LotPings
    Nov 20 '18 at 0:14











  • if not exist "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" mkdir "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" robocopy "C:UsersuserVirtualBox VMs" "E:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"

    – learner
    Nov 20 '18 at 0:42











  • Still not working

    – learner
    Nov 20 '18 at 0:42











  • Got it working by xcopy, robocopy is simply rubbish!

    – learner
    Nov 20 '18 at 1:44






  • 1





    Robocopy is by far superior. Unfortunate you do not understand the syntax and are unable to communicate how you are using it. Just telling us it is not working does not help anyone understand how to fix the problem.

    – Squashman
    Nov 20 '18 at 2:23
















0















I have written a batch file, the aim of the file is to stop vm, take a back up (Copy the entire Virtualbox VMs) folder to a different drive, start VMs.



Code is as below:



@echo on
cls
echo "Change directory to Virtualbox root directory"

cd /d "c:Program FilesOracleVirtualBox"

echo "Powering off Virtual machines"

VBoxManage controlvm "centos74.master" poweroff
PING localhost -n 30 >NUL

VBoxManage controlvm "centos74.agent" poweroff
PING localhost -n 30 >NUL

echo "Commence backup work"

cd /d E:
if not exist Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2% mkdir Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%
REM cd Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%
robocopy C:UsersuserVirtualBox VMs E:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%

echo "Change directory to Virtualbox root directory"

cd /d "c:Program FilesOracleVirtualBox"

echo "Starting Virtual machines"

VBoxManage startvm "centos74.master"

PING localhost -n 30 >NUL

VBoxManage startvm "centos74.agent"

PING localhost -n 30 >NUL

@echo off


I however have two issues.
1. robocopy in itself doesn't work, please find below execution error message



-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------

Started : Tuesday, 20 November 2018 9:19:03 AM
Source - C:UsersuserVirtualBox
Dest - E:VMs

Files :
Options : /DCOPY:DA /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------

ERROR : Invalid Parameter #3 : "E:Backup-2018-11-20"

Simple Usage :: ROBOCOPY source destination /MIR

source :: Source Directory (drive:path or \serversharepath).
destination :: Destination Dir (drive:path or \serversharepath).
/MIR :: Mirror a complete directory tree.

For more usage information run ROBOCOPY /?


**** /MIR can DELETE files as well as copy them !




  1. Not so important but still the below code is ineffective, meaning it should only create one and only folder even if you execute multiple times. When I execute multiple times it creates nested folder like



    E:Backup-20-Nov-2018Backup-20-Nov-2018Backup-20-Nov-2018




Buggy code:



if not exist Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2% mkdir Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%


Any assistance will be greatly appreciated.










share|improve this question























  • There is a space in the path `C:UsersuserVirtualBox VMs` so you have to double quote it (you should do that for all path variables possibly containing spaces)

    – LotPings
    Nov 20 '18 at 0:14











  • if not exist "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" mkdir "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" robocopy "C:UsersuserVirtualBox VMs" "E:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"

    – learner
    Nov 20 '18 at 0:42











  • Still not working

    – learner
    Nov 20 '18 at 0:42











  • Got it working by xcopy, robocopy is simply rubbish!

    – learner
    Nov 20 '18 at 1:44






  • 1





    Robocopy is by far superior. Unfortunate you do not understand the syntax and are unable to communicate how you are using it. Just telling us it is not working does not help anyone understand how to fix the problem.

    – Squashman
    Nov 20 '18 at 2:23














0












0








0








I have written a batch file, the aim of the file is to stop vm, take a back up (Copy the entire Virtualbox VMs) folder to a different drive, start VMs.



Code is as below:



@echo on
cls
echo "Change directory to Virtualbox root directory"

cd /d "c:Program FilesOracleVirtualBox"

echo "Powering off Virtual machines"

VBoxManage controlvm "centos74.master" poweroff
PING localhost -n 30 >NUL

VBoxManage controlvm "centos74.agent" poweroff
PING localhost -n 30 >NUL

echo "Commence backup work"

cd /d E:
if not exist Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2% mkdir Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%
REM cd Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%
robocopy C:UsersuserVirtualBox VMs E:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%

echo "Change directory to Virtualbox root directory"

cd /d "c:Program FilesOracleVirtualBox"

echo "Starting Virtual machines"

VBoxManage startvm "centos74.master"

PING localhost -n 30 >NUL

VBoxManage startvm "centos74.agent"

PING localhost -n 30 >NUL

@echo off


I however have two issues.
1. robocopy in itself doesn't work, please find below execution error message



-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------

Started : Tuesday, 20 November 2018 9:19:03 AM
Source - C:UsersuserVirtualBox
Dest - E:VMs

Files :
Options : /DCOPY:DA /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------

ERROR : Invalid Parameter #3 : "E:Backup-2018-11-20"

Simple Usage :: ROBOCOPY source destination /MIR

source :: Source Directory (drive:path or \serversharepath).
destination :: Destination Dir (drive:path or \serversharepath).
/MIR :: Mirror a complete directory tree.

For more usage information run ROBOCOPY /?


**** /MIR can DELETE files as well as copy them !




  1. Not so important but still the below code is ineffective, meaning it should only create one and only folder even if you execute multiple times. When I execute multiple times it creates nested folder like



    E:Backup-20-Nov-2018Backup-20-Nov-2018Backup-20-Nov-2018




Buggy code:



if not exist Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2% mkdir Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%


Any assistance will be greatly appreciated.










share|improve this question














I have written a batch file, the aim of the file is to stop vm, take a back up (Copy the entire Virtualbox VMs) folder to a different drive, start VMs.



Code is as below:



@echo on
cls
echo "Change directory to Virtualbox root directory"

cd /d "c:Program FilesOracleVirtualBox"

echo "Powering off Virtual machines"

VBoxManage controlvm "centos74.master" poweroff
PING localhost -n 30 >NUL

VBoxManage controlvm "centos74.agent" poweroff
PING localhost -n 30 >NUL

echo "Commence backup work"

cd /d E:
if not exist Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2% mkdir Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%
REM cd Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%
robocopy C:UsersuserVirtualBox VMs E:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%

echo "Change directory to Virtualbox root directory"

cd /d "c:Program FilesOracleVirtualBox"

echo "Starting Virtual machines"

VBoxManage startvm "centos74.master"

PING localhost -n 30 >NUL

VBoxManage startvm "centos74.agent"

PING localhost -n 30 >NUL

@echo off


I however have two issues.
1. robocopy in itself doesn't work, please find below execution error message



-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------

Started : Tuesday, 20 November 2018 9:19:03 AM
Source - C:UsersuserVirtualBox
Dest - E:VMs

Files :
Options : /DCOPY:DA /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------

ERROR : Invalid Parameter #3 : "E:Backup-2018-11-20"

Simple Usage :: ROBOCOPY source destination /MIR

source :: Source Directory (drive:path or \serversharepath).
destination :: Destination Dir (drive:path or \serversharepath).
/MIR :: Mirror a complete directory tree.

For more usage information run ROBOCOPY /?


**** /MIR can DELETE files as well as copy them !




  1. Not so important but still the below code is ineffective, meaning it should only create one and only folder even if you execute multiple times. When I execute multiple times it creates nested folder like



    E:Backup-20-Nov-2018Backup-20-Nov-2018Backup-20-Nov-2018




Buggy code:



if not exist Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2% mkdir Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%


Any assistance will be greatly appreciated.







batch-file






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 19 '18 at 23:58









learnerlearner

1501115




1501115













  • There is a space in the path `C:UsersuserVirtualBox VMs` so you have to double quote it (you should do that for all path variables possibly containing spaces)

    – LotPings
    Nov 20 '18 at 0:14











  • if not exist "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" mkdir "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" robocopy "C:UsersuserVirtualBox VMs" "E:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"

    – learner
    Nov 20 '18 at 0:42











  • Still not working

    – learner
    Nov 20 '18 at 0:42











  • Got it working by xcopy, robocopy is simply rubbish!

    – learner
    Nov 20 '18 at 1:44






  • 1





    Robocopy is by far superior. Unfortunate you do not understand the syntax and are unable to communicate how you are using it. Just telling us it is not working does not help anyone understand how to fix the problem.

    – Squashman
    Nov 20 '18 at 2:23



















  • There is a space in the path `C:UsersuserVirtualBox VMs` so you have to double quote it (you should do that for all path variables possibly containing spaces)

    – LotPings
    Nov 20 '18 at 0:14











  • if not exist "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" mkdir "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" robocopy "C:UsersuserVirtualBox VMs" "E:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"

    – learner
    Nov 20 '18 at 0:42











  • Still not working

    – learner
    Nov 20 '18 at 0:42











  • Got it working by xcopy, robocopy is simply rubbish!

    – learner
    Nov 20 '18 at 1:44






  • 1





    Robocopy is by far superior. Unfortunate you do not understand the syntax and are unable to communicate how you are using it. Just telling us it is not working does not help anyone understand how to fix the problem.

    – Squashman
    Nov 20 '18 at 2:23

















There is a space in the path `C:UsersuserVirtualBox VMs` so you have to double quote it (you should do that for all path variables possibly containing spaces)

– LotPings
Nov 20 '18 at 0:14





There is a space in the path `C:UsersuserVirtualBox VMs` so you have to double quote it (you should do that for all path variables possibly containing spaces)

– LotPings
Nov 20 '18 at 0:14













if not exist "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" mkdir "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" robocopy "C:UsersuserVirtualBox VMs" "E:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"

– learner
Nov 20 '18 at 0:42





if not exist "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" mkdir "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" robocopy "C:UsersuserVirtualBox VMs" "E:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"

– learner
Nov 20 '18 at 0:42













Still not working

– learner
Nov 20 '18 at 0:42





Still not working

– learner
Nov 20 '18 at 0:42













Got it working by xcopy, robocopy is simply rubbish!

– learner
Nov 20 '18 at 1:44





Got it working by xcopy, robocopy is simply rubbish!

– learner
Nov 20 '18 at 1:44




1




1





Robocopy is by far superior. Unfortunate you do not understand the syntax and are unable to communicate how you are using it. Just telling us it is not working does not help anyone understand how to fix the problem.

– Squashman
Nov 20 '18 at 2:23





Robocopy is by far superior. Unfortunate you do not understand the syntax and are unable to communicate how you are using it. Just telling us it is not working does not help anyone understand how to fix the problem.

– Squashman
Nov 20 '18 at 2:23












2 Answers
2






active

oldest

votes


















1














Fixing some double quoting, other things and using timeout 30 instead of ping command:



@echo on
cls
echo "Change directory to Virtualbox root directory"
cd /d "c:Program FilesOracleVirtualBox"
echo "Powering off Virtual machines"
VBoxManage controlvm "centos74.master" poweroff
timeout 30
VBoxManage controlvm "centos74.agent" poweroff
timeout 30
echo "Commence backup work"
cd /d E:
if not exist "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" mkdir "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"
REM cd "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"
robocopy "C:UsersuserVirtualBox VMs" "E:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" /r:0
echo "Change directory to Virtualbox root directory"
cd /d "c:Program FilesOracleVirtualBox"
echo "Starting Virtual machines"
VBoxManage startvm "centos74.master"
timeout 30
VBoxManage startvm "centos74.agent"
timeout 30
@echo off





share|improve this answer


























  • Many thanks to both of you. Since Gerhard went an extra mile, I have favored his as solution but technically both are right.

    – learner
    Nov 20 '18 at 14:13



















3














Your problem is that when including quotes to protect spaces, you need to avoid ending backslashes in the folder paths because they will escape the double quotes so the arguments will not end where you think (see this question for more information).



robocopy "C:UsersuserVirtualBox VMs" "e:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" /mir





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53384345%2frobocopy-returns-invalid-parameters%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Fixing some double quoting, other things and using timeout 30 instead of ping command:



    @echo on
    cls
    echo "Change directory to Virtualbox root directory"
    cd /d "c:Program FilesOracleVirtualBox"
    echo "Powering off Virtual machines"
    VBoxManage controlvm "centos74.master" poweroff
    timeout 30
    VBoxManage controlvm "centos74.agent" poweroff
    timeout 30
    echo "Commence backup work"
    cd /d E:
    if not exist "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" mkdir "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"
    REM cd "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"
    robocopy "C:UsersuserVirtualBox VMs" "E:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" /r:0
    echo "Change directory to Virtualbox root directory"
    cd /d "c:Program FilesOracleVirtualBox"
    echo "Starting Virtual machines"
    VBoxManage startvm "centos74.master"
    timeout 30
    VBoxManage startvm "centos74.agent"
    timeout 30
    @echo off





    share|improve this answer


























    • Many thanks to both of you. Since Gerhard went an extra mile, I have favored his as solution but technically both are right.

      – learner
      Nov 20 '18 at 14:13
















    1














    Fixing some double quoting, other things and using timeout 30 instead of ping command:



    @echo on
    cls
    echo "Change directory to Virtualbox root directory"
    cd /d "c:Program FilesOracleVirtualBox"
    echo "Powering off Virtual machines"
    VBoxManage controlvm "centos74.master" poweroff
    timeout 30
    VBoxManage controlvm "centos74.agent" poweroff
    timeout 30
    echo "Commence backup work"
    cd /d E:
    if not exist "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" mkdir "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"
    REM cd "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"
    robocopy "C:UsersuserVirtualBox VMs" "E:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" /r:0
    echo "Change directory to Virtualbox root directory"
    cd /d "c:Program FilesOracleVirtualBox"
    echo "Starting Virtual machines"
    VBoxManage startvm "centos74.master"
    timeout 30
    VBoxManage startvm "centos74.agent"
    timeout 30
    @echo off





    share|improve this answer


























    • Many thanks to both of you. Since Gerhard went an extra mile, I have favored his as solution but technically both are right.

      – learner
      Nov 20 '18 at 14:13














    1












    1








    1







    Fixing some double quoting, other things and using timeout 30 instead of ping command:



    @echo on
    cls
    echo "Change directory to Virtualbox root directory"
    cd /d "c:Program FilesOracleVirtualBox"
    echo "Powering off Virtual machines"
    VBoxManage controlvm "centos74.master" poweroff
    timeout 30
    VBoxManage controlvm "centos74.agent" poweroff
    timeout 30
    echo "Commence backup work"
    cd /d E:
    if not exist "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" mkdir "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"
    REM cd "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"
    robocopy "C:UsersuserVirtualBox VMs" "E:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" /r:0
    echo "Change directory to Virtualbox root directory"
    cd /d "c:Program FilesOracleVirtualBox"
    echo "Starting Virtual machines"
    VBoxManage startvm "centos74.master"
    timeout 30
    VBoxManage startvm "centos74.agent"
    timeout 30
    @echo off





    share|improve this answer















    Fixing some double quoting, other things and using timeout 30 instead of ping command:



    @echo on
    cls
    echo "Change directory to Virtualbox root directory"
    cd /d "c:Program FilesOracleVirtualBox"
    echo "Powering off Virtual machines"
    VBoxManage controlvm "centos74.master" poweroff
    timeout 30
    VBoxManage controlvm "centos74.agent" poweroff
    timeout 30
    echo "Commence backup work"
    cd /d E:
    if not exist "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" mkdir "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"
    REM cd "Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%"
    robocopy "C:UsersuserVirtualBox VMs" "E:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" /r:0
    echo "Change directory to Virtualbox root directory"
    cd /d "c:Program FilesOracleVirtualBox"
    echo "Starting Virtual machines"
    VBoxManage startvm "centos74.master"
    timeout 30
    VBoxManage startvm "centos74.agent"
    timeout 30
    @echo off






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Nov 20 '18 at 7:34

























    answered Nov 20 '18 at 7:12









    Gerhard BarnardGerhard Barnard

    6,96731131




    6,96731131













    • Many thanks to both of you. Since Gerhard went an extra mile, I have favored his as solution but technically both are right.

      – learner
      Nov 20 '18 at 14:13



















    • Many thanks to both of you. Since Gerhard went an extra mile, I have favored his as solution but technically both are right.

      – learner
      Nov 20 '18 at 14:13

















    Many thanks to both of you. Since Gerhard went an extra mile, I have favored his as solution but technically both are right.

    – learner
    Nov 20 '18 at 14:13





    Many thanks to both of you. Since Gerhard went an extra mile, I have favored his as solution but technically both are right.

    – learner
    Nov 20 '18 at 14:13













    3














    Your problem is that when including quotes to protect spaces, you need to avoid ending backslashes in the folder paths because they will escape the double quotes so the arguments will not end where you think (see this question for more information).



    robocopy "C:UsersuserVirtualBox VMs" "e:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" /mir





    share|improve this answer




























      3














      Your problem is that when including quotes to protect spaces, you need to avoid ending backslashes in the folder paths because they will escape the double quotes so the arguments will not end where you think (see this question for more information).



      robocopy "C:UsersuserVirtualBox VMs" "e:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" /mir





      share|improve this answer


























        3












        3








        3







        Your problem is that when including quotes to protect spaces, you need to avoid ending backslashes in the folder paths because they will escape the double quotes so the arguments will not end where you think (see this question for more information).



        robocopy "C:UsersuserVirtualBox VMs" "e:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" /mir





        share|improve this answer













        Your problem is that when including quotes to protect spaces, you need to avoid ending backslashes in the folder paths because they will escape the double quotes so the arguments will not end where you think (see this question for more information).



        robocopy "C:UsersuserVirtualBox VMs" "e:Backup-%date:~-4,4%-%date:~-7,2%-%date:~-10,2%" /mir






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 20 '18 at 7:21









        MC NDMC ND

        58.6k54880




        58.6k54880






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53384345%2frobocopy-returns-invalid-parameters%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            MongoDB - Not Authorized To Execute Command

            How to fix TextFormField cause rebuild widget in Flutter

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith