Jump to content

Run function not handling spaces when using 'Start'


AverageJoe
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

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...