Tagchen zusammen

Ich versuche mich gerade an einer Batch-Datei die eine Virtuelle Hard Disk erstellt, dort ein portables VirtualBox mit einer XP Ebene drauf kopiert und automatisch dieses startet.

Auf meinem Windows 7 64-Bit funktioniert das auch soweit, aber bei einem Kollegen der Windows 7 als 32-Bit nutzt kommen fehler und auch im DiskPart kommt ein Pop-Up worauf ich gerne verzichten würde.

Vielleicht denke ich nur kompliziert und es ist ganz einfach, oder ich hab da wirklich Fehler drinne und irgendwer kann mir helfen

Hier mal meine Menü-Gesteuerte Batch-Datei
Code:
@ECHO OFF
C:
CD\
CLS

:MENU
CLS
 
ECHO.
ECHO.
ECHO.
ECHO.
ECHO ============ MENU NAME ==========
ECHO ---------------------------------
ECHO  1.  Create a Virtual Hard Drive
ECHO ---------------------------------
ECHO  2.  Copy Virtual Windows XP SP3
ECHO ---------------------------------
ECHO  3.  Delete Virtual Hard Drive
ECHO ---------------------------------
ECHO  5.  Start Virtual Windows XP SP3
ECHO ---------------------------------
ECHO =======PRESS 'Q' TO QUIT=========
ECHO.

SET INPUT=
SET /P INPUT=Please select a number:

IF /I '%INPUT%'=='1' GOTO CreateOnDrive
IF /I '%INPUT%'=='2' GOTO CopyXPToDrive
IF /I '%INPUT%'=='3' GOTO DeleteFromDrive
IF /I '%INPUT%'=='5' GOTO StartVirtXP
IF /I '%INPUT%'=='Q' GOTO Quit

CLS
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO ============INVALID INPUT============
ECHO -------------------------------------
ECHO Please select a number from the Main
echo Menu [1-4 or 5] or select 'Q' to quit.
ECHO -------------------------------------
ECHO ======PRESS ANY KEY TO CONTINUE======
PAUSE > NUL
GOTO MENU

:CreateOnDrive
CLS
ECHO.
ECHO.
ECHO.
ECHO.
ECHO ==== Create a Virtual Hard Drive ====
ECHO -------------------------------------
ECHO.
SET Drive=
SET /P Drive=Please choose your Hard Drive (C/D/E/..): 
ECHO.
PushD "%~dp0" 
ECho.
ECHO.
ECHO Creating Script ...
MD %cd%\Temp
ECHO create vdisk file="%Drive%:\VirtualHardDisk\Win-XP-SP3.vhd" maximum=16384 type=fixed> %cd%\Temp\Create.txt
ECHO select vdisk file="%Drive%:\VirtualHardDisk\Win-XP-SP3.vhd">> %cd%\Temp\Create.txt
ECHO attach vdisk>> %cd%\Temp\Create.txt
ECHO create partition primary>> %cd%\Temp\Create.txt
ECHO assign letter=v>> %cd%\Temp\Create.txt
ECHO format fs=ntfs label="Win-XP-SP3" quick>> %cd%\Temp\Create.txt
ECHO exit>> %cd%\Temp\Create.txt
ECHO.
ECHO Execute Script with DiskPart ...
DiskPart /S %cd%\Temp\Create.txt
rd /S /Q %cd%\Temp
Pause > Nul
GOTO MENU


:CopyXPToDrive
CLS
ECHO.
ECHO.
ECHO.
ECHO.
ECHO ==== Copy Virtual Windows XP SP3 ====
ECHO -------------------------------------
ECHO.
ECHO.
ECHO.
PushD "%~dp0" 
echo %cd%
xcopy %cd%\Portable-VirtualBox /h /e V:\Portable-VirtualBox\
pause >nul

GOTO MENU


:DeleteFromDrive
CLS
ECHO.
ECHO.
ECHO.
ECHO.
ECHO ==== Remove a Virtual Hard Drive ====
ECHO -------------------------------------
ECHO.
SET Drive=
SET /P Drive=Please choose your Hard Drive (C/D/E): 
ECHO.
PushD "%~dp0" 
ECho.
ECHO.
ECHO Creating Script ...
MD %cd%\Temp
ECHO.
ECHO.
ECHO Creating Script ...
ECHO select vdisk file="%Drive%:\VirtualHardDisk\Win-XP-SP3.vhd"> %cd%\Temp\Remove.txt
ECHO detach vdisk>> %cd%\Temp\Remove.txt
ECHO exit>> %cd%\Temp\Remove.txt
ECHO.
ECHO Execute Script with DiskPart ...
DiskPart /S %cd%\Temp\Remove.txt
rd /S /Q %cd%\Temp
del /Q %cd%\Win-XP-SP3.vhd
Pause > Nul
GOTO MENU


:StartVirtXP
CLS
ECHO.
ECHO.
ECHO.
ECHO.
ECHO ==== Start Virtual Windows XP SP3 ====
ECHO --------------------------------------
ECHO.
ECHO.
ECHO.
ECHO Setting Home Directory ...
set VBOX_USER_HOME=V:\Portable-VirtualBox\data\.VirtualBox

ECHO.
ECHO. Check if you´re using x32 or x64-Bit Systems
if %PROCESSOR_ARCHITECTURE% == AMD64 goto 64bit
if %PROCESSOR_ARCHITECTURE% == x86 goto 32bit
 
:64bit
ECHO.
ECHO Starting VirtualBox Portable for x64-Bit System ...
cd /d v:\Portable-VirtualBox\
sc query pvboxdrv
sc stop pvboxdrv
sc delete pvboxdrv
sc create pvboxdrv binpath= %pvbroot%\drivers\vboxdrv\vboxdrv.sys type= kernel start= demand error= normal displayname= pvboxdrv
sc start pvboxdrv
%CD%\app64\VBoxManage.exe setextradata global GUI/Customizations noMenuBar,noStatusBar
%CD%\app64\VirtualBox.exe -startvm Windows-XP-SP3
GOTO MENU
 
:32bit
ECHO.
ECHO Starting VirtualBox Portable for x32-Bit System ...
cd /d v:\Portable-VirtualBox\
%CD%\app32\VBoxManage.exe setextradata global GUI/Customizations noMenuBar,noStatusBar
%CD%\app32\VirtualBox.exe -startvm Windows-XP-SP3
GOTO MENU


:Quit
CLS

ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO ==============THANKYOU===============
ECHO -------------------------------------
ECHO ======PRESS ANY KEY TO CONTINUE======
PAUSE>NUL
EXIT
Dann würde ich gerne das XP in VirtualBox Portable automatisch starten wollen. Aber bei einem normalen Start kann er irgendwelche Kernel-Treiber nicht starten.
Nach stundenlangen Suchen in Google und Foren, hab ich diese Batch-Datei gefunden:
Code:
echo off
SET pvbroot=D:\VirtualHardDisk\Portable-VirtualBox\app64
SET datadir=D:\VirtualHardDisk\Portable-VirtualBox

cd %pvbroot%
mkdir %datadir% 2>nul:

SET VBOX_USER_HOME=%cd%\Portable-VirtualBox\data

REM This service *has* to be loaded.  It manages the client's attempts to go to ring 0 (supervisor mode).
sc create pvboxdrv binpath= %pvbroot%\drivers\vboxdrv\vboxdrv.sys type= kernel start= demand error= normal displayname= pvboxdrv

REM USB support.  You don't have to use this service, but if you don't use it, 
REM the virtual machine won't have access to *physical* USB devices (just virtual ones).
sc create VBoxUSBMon binpath= %pvbroot%\drivers\USB\filter\VBoxUSBMon.sys type= kernel start= demand error= normal displayname= PortableVBoxUSBMon

ping -n 5 localhost>nul
REM The VirtualBox COM server
%pvbroot%\VBoxSVC.exe /reregserver

ping -n 5 localhost>nul
REM Client-side COM library. All COM objects that live on the client side
REM (i.e. inside the VM execution process) are contained in this file. So IConsole and friends go there. 
regsvr32.exe /S %pvbroot%\VBoxC.dll

ping -n 5 localhost>nul
REM Load the "VirtualBox Portable Runtime (IPRT)"
rundll32 %pvbroot%\VBoxRT.dll,RTR3Init

REM Start the ring-0 driver
sc start pvboxdrv

REM Start USB.  (Comment this out if you don't create the service.)
sc start VBoxUSBMon

ping -n 3 localhost>nul
REM Start the GUI
rem ... %pvbroot%\VirtualBox.exe
%pvbroot%\VBoxManage.exe setextradata global GUI/Customizations noMenuBar,noStatusBar
%pvbroot%\VirtualBox.exe -startvm Windows-XP-SP3

REM Count off seconds before you let it continue.  If you don't, you'll find that you have to reboot before you can run again.
ping -n 5 localhost>nul

REM Stop the ring-0 service
sc stop pvboxdrv

REM Stop the USB service
sc stop VBoxUSBMon

ping -n 5 localhost>nul




REM Make sure it is really stopped
sc query pvboxdrv
sc query VBoxUSBMon
ping -n 9 localhost>nul

REM Remove the VirtualBox COM service, i.e. all COM objects that live outside the VM process.
%pvbroot%\VBoxSVC.exe /unregserver


REM Remove Client-side COM library. All COM (or XPCOM) objects that live on the client side 
REM (i.e. inside the VM execution process) are contained in this file. So IConsole and friends go there. 
regsvr32.exe /S /U %pvbroot%\VBoxC.dll

ping -n 3 localhost>nul
sc delete pvboxdrv
sc delete VBoxUSBMon


echo
echo All done
ping -n 9 localhost>nul
Die erstellt wohl die gebrauchten Services und Einstellungen. Allerdings kann die wohl aus der VBoxRT.DLL den benötigten RTR3Init nicht benutzen. Hab auch nirgends was dazu gefunden

Vielleicht ist hier ja wer, der mir bei meinen Problemen helfen kann

thx in advance

Cheers

Skull