Jump to content

Get ridd of nasty spaces


walle
 Share

Recommended Posts

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

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

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...