Laddy Posted December 15, 2010 Share Posted December 15, 2010 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 Link to comment Share on other sites More sharing options...
JFX Posted December 15, 2010 Share Posted December 15, 2010 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) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now