Jump to content

UDF _StartRun()


lod3n
 Share

Recommended Posts

The problem is making a flexible enough parser to handle all of the potential command someone might try and enter. It's about handling spaces, slashes and quotes well enough to find and execute the correct command, with the correct parameters, OR opening the correct file with the correct application, OR detecting the requested protocol (http://, ftp://, res://, etc.) and correctly opening the associated application. Any one of these items is simple enough on it's own, but to make something smart enough to tell what kind of random command you've specified and correctly executing it is tricky.

I guess you will need wizard skills and a pretty good glass bulb (you know the wizard thing) to look in to manage all of that...:rolleyes:

It's like they say 20% of the work will cover 80% of your needs.

Link to comment
Share on other sites

Er..slight problem. You can omit extensions only for directories other than the CWD..for example, I have a file 'envvars.txt' in the same directory as the script - if I enter envvars it does not work, if I enter notepad or a txt file that's in a different directory but in the PATH it works. Adding 'txt' to it works.

[Edit]

Obviously that's because of the built-in ShellExecute being used in the 98 version. :rolleyes: It works with the normal version. Nevermind then, I'll use both and use a check OS function.

[Edit2]

Er...apparently not. It only opens exe's, etc..probably from the known types thing. Nevermind then..

Edited by Jettison
[font="Impact"]Cats rule, humans drool.[/font]
Link to comment
Share on other sites

Just a thought. Here's a function I wrote for myself to get the extensions for the first file name that matches (any extension):

Func _CheckExt()
    If Not StringInStr($run, ".", 0, -1) Then
        $first = FileFindFirstFile($run & ".*")
        $next = FileFindNextFile($first)
        If @error <> 1 Then
            Global $run = $next
        EndIf
    EndIf
EndFunc
Edited by Jettison
[font="Impact"]Cats rule, humans drool.[/font]
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...