Jump to content

Syntax help Please


Street
 Share

Recommended Posts

The problem im finding is that the divx player application stats with unrecognized format.

Here is what i mean.

Applications need to be launched in a dos like environment.

EG: Divx_Player.exe "No White spaces"

The problem is that Divx has a application name with a white space

EG: Divx Player.exe

So im trying to make a GUI with a Button to open DivX when pressed im lost as to how to try and get the script to ignore the white space.

Can someone help out here please.

Here is my Run structure

Run("q:\DivX\DivX Player\DivX Player.exe")

I know i can change the name of the file to get rid of the white space.

Problem with that is Windows will loose some of its ability to recognize how to open some files with Divx then.

Link to comment
Share on other sites

Very odd ive been working and fooling around with this and all of a sudden it started to open up correctly no code change to the command path.

Very odd.

Well thx for takeing a look at my post anyways in a attempt to try to help me out.

Link to comment
Share on other sites

Orrrr.

Run('"C:\Program Files\DivX\DivX Player\DivX Player.exe"')

Notice the ' (apostrophe) on either end of the string. This tells the string that you want it to contain " marks instead of seeing them as the delimiter to the string.

You can also double the quotation marks.

IE: Both of these examples work fine:

$string = "He said, ""Hello."" Then I exploded."
$string = 'He said, "Hello." Then I exploded.'

They both return:

He said, "Hello." Then I exploded.

Edit: This is handy for when you want to pass arguments that might contain a space.

Like:

Run('"C:\Program Files\DivX\DivX Player\DivX Player.exe" "C:\Documents and Settings\User\My Documents\My Videos\Transformers - The Movie.mpeg"')

Or should that be .avi... eh, whatever.

Edited by Saunders
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...