walle Posted September 11, 2007 Share 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) Link to comment Share on other sites More sharing options...
Developers Jos Posted September 11, 2007 Developers Share 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. Link to comment Share on other sites More sharing options...
walle Posted September 11, 2007 Author Share 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. Link to comment Share on other sites More sharing options...
weaponx Posted September 11, 2007 Share 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 Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 11, 2007 Share 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 Link to comment Share on other sites More sharing options...
MHz Posted September 11, 2007 Share 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) Link to comment Share on other sites More sharing options...
walle Posted September 11, 2007 Author Share Posted September 11, 2007 That really helped Thank you! 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