Uten Posted June 29, 2007 Share Posted June 29, 2007 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...It's like they say 20% of the work will cover 80% of your needs. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Jettison Posted June 29, 2007 Share Posted June 29, 2007 (edited) 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. 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 June 29, 2007 by Jettison [font="Impact"]Cats rule, humans drool.[/font] Link to comment Share on other sites More sharing options...
Jettison Posted June 29, 2007 Share Posted June 29, 2007 (edited) 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 June 29, 2007 by Jettison [font="Impact"]Cats rule, humans drool.[/font] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now