Jump to content
Sign in to follow this  
AverageJoe

Run function not handling spaces when using 'Start'

Recommended Posts

AverageJoe

Hi everyone,

got a little project here. I intend of writting all the files to an array using '_FileListToArray' so i can filter just the files i want.

Then ill open them one at a time using 'run' however -

the 'Start' command will not handle spaces in the filenames - i've tried lots of things here to get around it.

I started with the entire path -

$stringPath = "C:\Documents and Settings\joconno2\My Documents\UTStudioScriptingProject\TestInputFolder\THICKNESS _ PIMM_3058 3062.utdata"

MsgBox ( 0, "Checking string", $stringPath)

$ProgramCall = Run(@ComSpec & " /c " & 'Start' & $stringPath)

If 0 == $ProgramCall Then
    MsgBox (262144, "Failed", "Failed to load veo software")
EndIf

and it tells me C:Documents" cannot be found - fair enough i think :-)

so i looked at how to get around the spaces,

$stringPath = "C:\Documents and Settings\joconno2\My Documents\UTStudioScriptingProject\TestInputFolder\"
$filename = "THICKNESS _ PIMM_3058 3062.utdata"


MsgBox ( 0, "Checking string", $stringPath)

$ProgramCall = Run(@ComSpec & " /c " & 'Start' & $filename , $stringPath, @SW_HIDE)

and still no luck, it says it cannot find "THICKNESS" - which really is an iteration of my first concern

and if I can it will be massively helpful to use the spaces in the file name, becasue the equipment we use that makes the .utdata files is best used by making file names with spaces.

Cheers Everyone

Joey

Share this post


Link to post
Share on other sites
trancexx

You have this string:

$stringPath = "C:\Documents and Settings\joconno2\My Documents\UTStudioScriptingProject\TestInputFolder\THICKNESS _ PIMM_3058 3062.utdata"

...Added here:

@ComSpec & " /c " & 'Start' & $stringPath

That would get you this:

"C:\Windows\system32\cmd.exe /c StartC:\Documents and Settings\joconno2\My Documents\UTStudioScriptingProject\TestInputFolder\THICKNESS _ PIMM_3058 3062.utdata"

So, it really makes no sense. 

Add space after "Start".


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Richard Robertson

You also need to quote filenames when used in this fashion, or convert them to short filenames which still exist for legacy purposes.

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  

×