Sign in to follow this  
Followers 0
walle

Get ridd of nasty spaces

7 posts in this topic

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



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

#4 ·  Posted (edited)

$Image= 'OfficeXP.iso'
$Drivernumber= '1'
$get = Run(StringFormat(@ScriptDir & "\miso.exe %s -b %s", $Image, $Drivernumber),"",$STDOUT_CHILD, @SW_HIDE)

Edited by weaponx

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 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

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

That really helped :)

Thank you!

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