Sign in to follow this  
Followers 0
Laddy

problem with FileOpenBox and RunWait redirection

2 posts in this topic

Hello

Hello

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

how?

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

Laddy

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  
Followers 0