locked
Can't stop robocopy in taskmanager, when it runs with vbs run command RRS feed

  • Question

  • Hi,

    I start a robocopy command within a .cmd by a vbs script for that robocopy runs in background.


    VBS:

    Dim WinScriptHost
    Set WinScriptHost = CreateObject("WScript.Shell")
    WinScriptHost.Run Chr(34) & "C:\copy.cmd" & Chr(34), 0
    Set WinScriptHost = Nothing


    copy.cmd:

    robocopy.exe C:\Temp1\ C:\Temp2 *.csv /MON:1 /mov


    I can stop robocopy only with the "taskkill" command and not by the taskmanager.

    When i stop the process in the taskmanager, robocopy stays running (it still moves the files).

    When i execute the robocopy command directly in the command prompt (not in the background by VBS), i can stop it by the taskmanager.

    Why?

    Sunday, February 23, 2020 12:01 PM

Answers

  • If I remember correctly, the only answer I found was missing drivers. Unsatisfactory but I didn't pursue it after searching for hours. Only a reboot helped.
    • Marked as answer by ILT5000 Saturday, September 19, 2020 7:29 PM
    Saturday, September 19, 2020 7:29 PM

All replies

  • The process tab request programs to close. The details tab forces programs to close.

    CreateObject("WScript.Shell").Run Chr(34) & "C:\copy.cmd" & Chr(34), 0

    is all you need in your script.


    David Candy


    • Edited by DavidMCandy Sunday, February 23, 2020 8:06 PM
    Sunday, February 23, 2020 8:01 PM
  • If I remember correctly, the only answer I found was missing drivers. Unsatisfactory but I didn't pursue it after searching for hours. Only a reboot helped.
    • Marked as answer by ILT5000 Saturday, September 19, 2020 7:29 PM
    Saturday, September 19, 2020 7:29 PM