Is there a way to make a for loop that will call for the $VM1 then $VM2 then $VM3 etc including $Title1, $Title2 etc? OpenVM1()
OpenVM2()
OpenVM3()
OpenVM4()
Func OpenVM1()
;Open a vm window from the command line.
$VM1 = Run('"C:\Program Files\Oracle\VirtualBox\VirtualBox.exe" --comment "Win8-1" --startvm "5ebbcf32-3392-45db-bd65-98fe93a1cfb5"')
Sleep(60 * 1000)
$Title1 = WinGetTitle($VM1)
WinMove($Title1,"",0,0)
EndFunc
Func OpenVM2()
;Open a vm window from the command line.
$VM2 = Run('"C:\Program Files\Oracle\VirtualBox\VirtualBox.exe" --comment "Win8-2" --startvm "5ebbcf32-3392-45db-bd65-98fe93a1cfb5"')
Sleep(60 * 1000)
$Title2 = WinGetTitle($VM2)
WinMove($Title2,"",0,0)
EndFunc
Func OpenVM3()
;Open a vm window from the command line.
$VM3 = Run('"C:\Program Files\Oracle\VirtualBox\VirtualBox.exe" --comment "Win8-3" --startvm "5ebbcf32-3392-45db-bd65-98fe93a1cfb5"')
Sleep(60 * 1000)
$Title3 = WinGetTitle($VM3)
WinMove($Title3,"",0,0)
EndFunc
Func OpenVM4()
;Open a vm window from the command line.
$VM4 = Run('"C:\Program Files\Oracle\VirtualBox\VirtualBox.exe" --comment "Win8-4" --startvm "5ebbcf32-3392-45db-bd65-98fe93a1cfb5"')
Sleep(60 * 1000)
$Title4 = WinGetTitle($VM4)
WinMove($Title4,"",0,0)
EndFunc