Posts: 1622 Reputation: 50
36 / /
Joined: Jan 2006
RE: another request
quote:Originally posted by skyserpent
in this code:
var WSH = new ActiveXObject('WScript.Shell');
nPies = WSH.RegRead(MsgPlus.ScriptRegPath + "numberofpies");
where do i put the registry path?
and yes, i am new to this lol
MsgPlus.ScriptRegPath + "numberofpies" is the registry path (including the registry name) and nPies is the variable that you are asining the value of the registry to.
im still not quite sure what you mean... could you please show me how i would read the registry path: HKEY_CURRENT_USER\Software\Microsoft\Keyboard\Native Media Players\WMP and the reg name: AppName
thanks
This post was edited on 08-24-2006 at 03:49 PM by skyserpent.
Posts: 1622 Reputation: 50
36 / /
Joined: Jan 2006
RE: another request
code:var WSH = new ActiveXObject('WScript.Shell');
var App_Name = WSH.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Keyboard\\Native Media Players\\WMP\\AppName");
Debug.Trace(App_Name);
This will also return the AppName into the script debugging window for you too. Make sure you always use \\ and not just \ because this is the way JScript has to have it.
It's not recommend to use full paths since they can differ on other systems. However, this is how you should do it that way:
code:var WSH = new ActiveXObject('WScript.Shell');
wmpAppName = WSH.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Keyboard\Native Media Players\WMP\AppName");
Posts: 1622 Reputation: 50
36 / /
Joined: Jan 2006
RE: RE: another request
quote:Originally posted by Mattike
It's not recommend to use full paths since they can differ on other systems. However, this is how you should do it that way:
code:var WSH = new ActiveXObject('WScript.Shell');
wmpAppName = WSH.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Keyboard\Native Media Players\WMP\AppName");
Each of the \ shuld be \\ in JScript when looking through folders. Also for something like this it is very difficult to make a variable path (see my post). Actually I don't think this registry path can be any different anyway or else you would run into troubles elsewhere (I could be horribly wrong though).
This post was edited on 08-24-2006 at 04:05 PM by markee.
ok, well thanks for this... just a few more questions...
is there a way of getting the script to check if WMP is running then if it is change my PSM to something and if it isnt running change my PSM to something else?