2 Pages V   1 2 >  
Reply to this topic
 Little Help needed, coding registry links
post Feb 5 2010, 11:25 PM
Post #1
MedEvil
Platinum Member   ******
Group: .script developer

  Joined: 29-December 06
Posts: 5,256
Thank(s): 156


I have a little problem. To do file associations for a script, i need to write registry calls which need to also specify the folder in which to execute the called program.
Has anyone another idea but calling a shortcut with said settings?

cheers.gif


--------------------
NaughtyPE - The Multimedia PE!
Requirements: WinBuilder080, XPSP2/W2k3SP1 source, Pentium CPU, 128MB RAM (256MB to use video players)


+Quote Post
post Feb 6 2010, 12:57 AM
Post #2
Wonko the Sane
Gold Member   *****
Group: Advanced user

  Joined: 8-January 10 From: The Outside of the Asylum

Posts: 2,277
Thank(s): 252


Italy


Are you going to post an example of what you are wanting to do, or are you using the usual "secrecy is vital" or "too much info is no good" approach?

cheers.gif

Wonko


--------------------
+Quote Post
post Feb 6 2010, 05:38 PM
Post #3
MedEvil
Platinum Member   ******
Group: .script developer

  Joined: 29-December 06
Posts: 5,256
Thank(s): 156


When one clicks on a .html file for instance, then Windows checks the registry class for a key called .html.
Looks then inside for the default action and then what command is set to be executed with the default action, in this case open.

Command looks like this: "%ProgramFiles%\CD-Opera\Opera.exe" "%1"

As long as i use absolute paths in the Opera configuration file, there are no problems. But when i use relative paths for a new feature, the Opera.exe doesn't find most of its components, because the command is executed in the folder the html file is in.

cheers.gif


--------------------
NaughtyPE - The Multimedia PE!
Requirements: WinBuilder080, XPSP2/W2k3SP1 source, Pentium CPU, 128MB RAM (256MB to use video players)
+Quote Post
post Feb 6 2010, 05:46 PM
Post #4
psc
Guru   ******
Group: .script developer

  Joined: 14-July 06 From: Korschenbroich

Posts: 9,729
Thank(s): 657


Germany


Maybe I'm some more stupid than Wonko thinks, that users are: dubbio.gif

But even with your new explanation I do not understand the real issue of your question.

Peter cheers.gif


--------------------
Build the house starting with the basement rather than with the roof! But always have in mind how the roof should be made!

There are very rarely problems, in most cases there are issues.

There are never stupid questions, there can be only stupid answers.

It does not make much sence to heal the symptoms of an illness. You must heal the illness!
+Quote Post
post Feb 6 2010, 06:03 PM
Post #5
was_JFX
Frequent Member   ***
Group: Advanced user

  Joined: 13-December 07
Posts: 486
Thank(s): 249


Germany


My, my and I thought I would have problems explaining thinks. Hope this what you want?

Workdir.cmd "%ProgramFiles%\CD-Opera\Opera.exe" "%1"

CODE
Cd /d %~dp0
"%1" "%2"


cheers.gif


--------------------
+Quote Post
post Feb 6 2010, 06:09 PM
Post #6
Wonko the Sane
Gold Member   *****
Group: Advanced user

  Joined: 8-January 10 From: The Outside of the Asylum

Posts: 2,277
Thank(s): 252


Italy


I don't think that members are stupid, I think that Medevil normally does his best to avoid posting clear questions, omitting examples, details and more genrally completely failing to help in being helped. (and that psc often does his best to avoid posting clear answers, but that's another topic).

@psc
Don't worry, the question is not yet clear, I anyway think I might have understood some parts of it and can provide a tentative suggestion. (that will be later discarded by Medevil as being either not what he wanted or wroong, or not the way he likes it, or for any other reason)

@Medevil
Which OS/kind of PE are we talking about? unsure.gif

Use a variable with SETX or a similar "global" app variable I can suggest the much better SETENV:
http://barnyard.syr.edu/~vefatica/#SETENV
CODE
SETENV syntax:

  To set or change the value of a variable:

     User environment:           setenv -u name value        (also /u)
     Machine environment:        setenv -m name value        (also /m)
     Default user environment:   setenv -d name value        (also /d)
     Volatile environment:       setenv -v name value        (also /v)

  To display a variable:     setenv -u|-m|-d|-v name

  To delete a variable:      setenv -u|-m|-d|-v name -delete   (also /delete)

  To display an environment: setenv -u|-m|-d|-v

  Use double-quotes around values containing spaces.

  If a variable name or value is to CONTAIN a double-quote,
  escape that double-quote as \"

  Return codes: 0 = success        1 = variable not found
                2 = access denied  3 = other error
                4 = SETENV has shown this syntax message

  Requested output goes to STDOUT; help and error messages to STDERR.


Of course at some given time you need to know the full path to the app in order to set the variable.

Or are you talking about specific OPERA settings / .ini? dubbio.gif

cheers.gif

Wonko


--------------------
+Quote Post
post Feb 6 2010, 06:13 PM
Post #7
psc
Guru   ******
Group: .script developer

  Joined: 14-July 06 From: Korschenbroich

Posts: 9,729
Thank(s): 657


Germany


Here we are in a similar situation like:
QUOTE
Programming means:
To explain a partner with IQ = 0 and a vocabulary of 1000 words a task that he should perform.
Good programming means:
The partner understands it, and also performs as planned.

Why is it so difficult to explain simply?


Peter frusty.gif

EDIT: Cross posting.
This is not the reply to Wonko's post.

This reply is meant to JFX's post or Medevil's explanation resp.


--------------------
Build the house starting with the basement rather than with the roof! But always have in mind how the roof should be made!

There are very rarely problems, in most cases there are issues.

There are never stupid questions, there can be only stupid answers.

It does not make much sence to heal the symptoms of an illness. You must heal the illness!
+Quote Post
post Feb 6 2010, 06:19 PM
Post #8
psc
Guru   ******
Group: .script developer

  Joined: 14-July 06 From: Korschenbroich

Posts: 9,729
Thank(s): 657


Germany


QUOTE (Wonko the Sane @ Feb 6 2010, 08:09 PM) *
(and that psc often does his best to avoid posting clear answers, but that's another topic).

It there an artistic member who can create a "WB - Oscar" smiley?

I would like to suggest Wonko as high priority candidate!

Peter cheers.gif


--------------------
Build the house starting with the basement rather than with the roof! But always have in mind how the roof should be made!

There are very rarely problems, in most cases there are issues.

There are never stupid questions, there can be only stupid answers.

It does not make much sence to heal the symptoms of an illness. You must heal the illness!
+Quote Post
post Feb 6 2010, 07:06 PM
Post #9
Wonko the Sane
Gold Member   *****
Group: Advanced user

  Joined: 8-January 10 From: The Outside of the Asylum

Posts: 2,277
Thank(s): 252


Italy


QUOTE (psc @ Feb 6 2010, 07:13 PM) *
This reply is meant to JFX's post or Medevil's explanation resp.


You should make up your mind... happy22.gif

QUOTE (psc @ Feb 6 2010, 07:19 PM) *
It there an artistic member who can create a "WB - Oscar" smiley?


What about one of these:






cheers.gif

Wonko


--------------------
+Quote Post
post Feb 6 2010, 07:08 PM
Post #10
was_JFX
Frequent Member   ***
Group: Advanced user

  Joined: 13-December 07
Posts: 486
Thank(s): 249


Germany


QUOTE (psc @ Feb 6 2010, 06:13 PM) *
EDIT: Cross posting.
This is not the reply to Wonko's post.

This reply is meant to JFX's post or Medevil's explanation resp.


C'mon I explained very well, but how give clear answer to an unclear question happy22.gif

Simply put this Workdir.cmd file in the working dir, what the application needs wink.gif

It will change the current working dir to where the *.cmd is put.

Then it execute %1 ("%ProgramFiles%\CD-Opera\Opera.exe") with parameter %2

cheers.gif


--------------------
+Quote Post

2 Pages V   1 2 >
Reply to this topic
1 User(s) are reading this topic ()



Collapse

  Topic Replies Topic Starter Views Last Action
No New Posts Help please! problems in 1st build attempt
Vista PE 1st Build
1 dlands 146 1st September 2010 - 11:34 AM
Last post by: dera
No New Posts help to compile grub4dos
7 oscark 457 25th August 2010 - 04:38 PM
Last post by: oscark
No New Posts Help Please !!!!!!!!!!!!!!!!!!!!
3 dr_emad 294 23rd August 2010 - 10:41 PM
Last post by: Nuno Brito
No New Posts Help wanted in imaging a 2003 server and xferring onto new h/w
13 steve6375 801 9th August 2010 - 12:00 PM
Last post by: MichaelZ
No New Posts Help the Noob Please
2 HelpNoob 322 3rd August 2010 - 05:06 PM
Last post by: Nuno Brito