walle 0 Posted September 11, 2007 How do I change the third line in the code so that I get ridd of thoose nasty spaces before officexp.iso and 1. Tried to put more spaces between 'miso.exe' & $Image', didnt work, tried added 'miso.exe' & ' ' & $Image. Didn't work. Any idea? $Image= ' OfficeXP.iso ' $Drivernumber= ' 1 ' $get = Run(@ScriptDir & '\' & 'miso.exe' & $Image & '-b' & $Drivernumber,"",$STDOUT_CHILD, @SW_HIDE) Share this post Link to post Share on other sites
Jos 2,281 Posted September 11, 2007 StringStripWS($Image,2) Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
walle 0 Posted September 11, 2007 Sorry for my bad english, maybe hard to understand. The thing is that the spaces in $Image= ' OfficeXP.iso ' is needed in the third line. The dos command requier space between miso.exe and OfficeXP.iso. In my final script, there is no spaces before OfficeXP.iso, I just putted them temporary to get the third line working. Share this post Link to post Share on other sites
weaponx 16 Posted September 11, 2007 (edited) $Image= 'OfficeXP.iso' $Drivernumber= '1' $get = Run(StringFormat(@ScriptDir & "\miso.exe %s -b %s", $Image, $Drivernumber),"",$STDOUT_CHILD, @SW_HIDE) Edited September 11, 2007 by weaponx Share this post Link to post Share on other sites
PsaltyDS 42 Posted September 11, 2007 (edited) By convention, most people leave extra spaces, trailing slashes, etc. OFF of their variables and then include them in any assembled string as required: $Image= 'OfficeXP.iso' $Drivernumber= '1' $get = Run(@ScriptDir & '\miso.exe ' & $Image & ' -b ' & $Drivernumber,"",$STDOUT_CHILD,@SW_HIDE)oÝ÷ ØÌ©z»(©içÞéÜz+-¡«,zfåzØ^²Ú⥪ڵérjëh×6$sExtCmd = @ScriptDir & '\miso.exe ' & $Image & ' -b ' & $Drivernumber $get = Run($sExtCmd,"",$STDOUT_CHILD, @SW_HIDE) That adds an extra line, but makes debugging and logging much easier because you can ConsoleWrite() or MsgBox() the string if you suspect it isn't coming out right. Edit: Correcting typos, while working around the forum bug... Edited September 11, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Share this post Link to post Share on other sites
MHz 80 Posted September 11, 2007 Perhaps this may help. Use double quotes in case of spaces with in the path. $Image = 'OfficeXP.iso' $Drivernumber = '1' $get = Run('"' & @ScriptDir & '\miso.exe" "' & $Image & '" -b ' & $Drivernumber, '', $STDOUT_CHILD, @SW_HIDE) Share this post Link to post Share on other sites
walle 0 Posted September 11, 2007 That really helped Thank you! Share this post Link to post Share on other sites