diff --git a/samples/vboxwrapper/vbox_vboxmanage.cpp b/samples/vboxwrapper/vbox_vboxmanage.cpp
index 2b83fe6addb..1580b1f43db 100644
--- a/samples/vboxwrapper/vbox_vboxmanage.cpp
+++ b/samples/vboxwrapper/vbox_vboxmanage.cpp
@@ -16,6 +16,7 @@
// along with BOINC. If not, see .
#ifdef _WIN32
+#include
#include "boinc_win.h"
#include "win_util.h"
#else
@@ -532,12 +533,20 @@ namespace vboxmanage {
string medium_file = aid.project_dir;
medium_file += "/" + multiattach_vdi_file;
+#ifdef _WIN32
+ replace(medium_file.begin(), medium_file.end(), '\\', '/');
+#endif
+
vboxlog_msg("Adding virtual disk drive to VM. (%s)", multiattach_vdi_file.c_str());
command = "list hdds";
retval = vbm_popen(command, output, "check if parent hdd is registered", false, false);
if (retval) return retval;
+#ifdef _WIN32
+ replace(output.begin(), output.end(), '\\', '/');
+#endif
+
if (output.find(medium_file) == string::npos) {
// parent hdd is not registered
// vdi files can't be registered and set to multiattach mode within 1 step.