You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.8 KiB

From 88429f56491ed0e5b3f5f91e6e352fa1251484bc Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <>
Date: Mon, 30 Nov 2020 08:55:34 +0000
Subject: [PATCH] v2v: windows: Fix schtasks /SD parameter.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Thanks: Dinesh Herath, Tomáš Golembiovský, Bryan Kinney, Mark Zealey
(cherry picked from commit b65711c9293415f671d35d0e2f9b55a74343da45)
v2v/ | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/v2v/ b/v2v/
index 44cef5ed..4d844e2d 100644
--- a/v2v/
+++ b/v2v/
@@ -422,11 +422,12 @@ popd
and configure_qemu_ga files =
List.iter (
fun msi_path ->
+ (* Windows is a trashfire. *)
let fb_script = sprintf "\
echo Removing any previously scheduled qemu-ga installation
schtasks.exe /Delete /TN Firstboot-qemu-ga /F
echo Scheduling delayed installation of qemu-ga from %s
-powershell.exe -command \"$d = (get-date).AddSeconds(120); schtasks.exe /Create /SC ONCE /ST $d.ToString('HH:mm') /SD $d.ToString('MM/dd/yyyy') /RU SYSTEM /TN Firstboot-qemu-ga /TR \\\"C:\\%s /forcerestart /qn /l+*vx C:\\%s.log\\\"\"
+powershell.exe -command \"$d = (get-date).AddSeconds(120); $FormatHack = ($([System.Globalization.DateTimeFormatInfo]::CurrentInfo.ShortDatePattern) -replace 'M+/', 'MM/') -replace 'd+/', 'dd/'; schtasks.exe /Create /SC ONCE /ST $d.ToString('HH:mm') /SD $d.ToString($FormatHack) /RU SYSTEM /TN Firstboot-qemu-ga /TR \\\"C:\\%s /forcerestart /qn /l+*vx C:\\%s.log\\\"\"
msi_path msi_path msi_path in
Firstboot.add_firstboot_script g inspect.i_root