1.

Solve : URI using registry keys?

Answer»

Hello

i am working on a custom URI to open a link on an external PROGRAM when on a web browser.

In order for this to work i have the URI link open a custom program which removes the first 5 characters of the link so that it is usable by the program (VLC).

If i want to refference the program directly using the URI my registry command would be:

Code: [Select]"C:\Program Files\VideoLAN\VLC\vlc.exe" --FULLSCREEN "%1"
however this still includes the 5 characters which are normal removed by the custom program. Is there a way of removing the first 5 character of the variable %1 within the registry entry / key?

(I may not be using the correct terminology but i hope i have put what i am looking for in an understandable format)

as an example i have a link which is in the form "vlc://someURL" when the code i quoted earlier is used it passes on the whole string as the variable %1 however i would like to remove the first 5 chars (vlc://) so that only "someURL" is passed.So you already have a program that can grab the url and pass it into command line? And your just looking to strip the first 5 characters from it?


Is there a way to write the info to a text file from where ever its coming from? If so a simple batch file could clean up to remove the first 5 characters and write the trimmed URL to another file. This other file less the first 5 characters can be targeted to grab the URL from.

I already have a batch file which does this, however i was looking to see if it was possible to do it without the batch file. Quote

I already have a batch file which does this, however i was looking to see if it was possible to do it without the batch file.

YES ... however with so many CHOICES of how to do this without batch, we would need to know what language / format = ( Scripted ... compiled on the fly like a Perl Interpreter for a .PL file or Compiled from .CPP to .EXE like with C++ ) you want it in.

Curious as to why your looking for an alternate scripted or compiled solution since batch works fine for you and you already have a batch solution that matches everything you need it to do?

Batch is probably the most compatible with systems if sharing with others, as for when you start programming it into a language you then have to worry about dependencies. Additionally the batch file to do this is quite small compared to the many lines of code to pull off the same process in say C++ where you have to have file open and file close declarations etc. My first choice for a problem like this if I didnt have the batch solution already available to me would be to CREATE it in batch. Not unless it was for a school project or a program that I plan to SHARE with others and slap my name on it would I go into anything more professional looking in say C++ etc.Unfortunately the Registry key parameter format is rather inflexible- I don't believe it is even capable of performing the string manipulations of batch to strip out portions of the string. I'm not 100% sure if it doesn't support that- if it does, you ought to be able to use %1:~5,0%


Discussion

No Comment Found