Jump to content
Sign in to follow this  

problem with FileOpenBox and RunWait redirection

Recommended Posts




I have a problem with FileOpenDialog and forwarding a file (InfoSourceVDI.txt) from the command RunWait

The script creates a file documents at the root of my hard drive.

The script creates a file "Documents" at the root of my hard drive.

It is a problem in the Path of my txt file but I can not add quotes


Global $SunVirtualBox = RegRead("HKEY_LOCAL_MACHINE\Software\Sun\VirtualBox", "InstallDir")
Local $ListInfo = @ScriptDir &"\InfoSourceVDI.txt"
Local $message = "Selectionne la source de ton fichier VDI."
Local $var = FileOpenDialog($message, @DesktopDir & "\", "Fichiers VirtualBox (*.vdi)", 1)

IniWrite( @ScriptDir &"\CloneVDIinfo.ini","parametres","Source",$var)

$IniSource = IniRead(@ScriptDir &"\CloneVDIinfo.ini", "parametres", "Source", "NotFound")
RunWait(@ComSpec & ' /c "' &$SunVirtualBox&'VBoxManage.exe"' &" showhdinfo " &$IniSource &" > " &$ListInfo, "", @SW_HIDE)

Path of RunWait :

C:\Windows\system32\cmd /c "C:\Program files\Sun\Virtualbox\VboxManage.exe" showdinfo F:\xpro.vdi > C:\documents and settings\Laddy\Bureau\InfoSourceVDI.txt

I would like this :

C:\Windows\system32\cmd /c "C:\Program files\Sun\Virtualbox\VboxManage.exe" showdinfo F:\xpro.vdi > "C:\documents and settings\Laddy\Bureau\InfoSourceVDI.txt"

Thank a lot for your help


Share this post

Link to post
Share on other sites

Hi Laddy,

cmd.exe is a bit complicated with quotes, so try add the path as workingdir to avoid the first quotes.

RunWait(@ComSpec & ' /c VBoxManage.exe' & ' showhdinfo "' &$IniSource & '" > "' &$ListInfo & '"', $SunVirtualBox, @SW_HIDE)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.