What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Help! Running a file in script folder

Help! Running a file in script folder
Author: Message:
confa
New Member
*


Posts: 3
28 / Male / Flag
Joined: Feb 2010
O.P. Shocked  Help! Running a file in script folder
hi guys! I need some help with this code!

code:
...
var shell = new ActiveXObject("WScript.shell");
shell.run("C:\\Program Files\\Messenger Plus! Live\\Scripts\\ScriptFolder\\MSN.exe");
...


that path works only in Windows 7 32 bit... so I tried...

code:
...
var shell = new ActiveXObject("WScript.shell");
var MSNexe = MsgPlus.ScriptFilesPath + "\\MSN.exe"
shell.run(MSNexe);
...


but it doesn't works! why??
02-22-2010 06:56 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Help! Running a file in script folder
Both should work...
02-22-2010 07:11 PM
Profile E-Mail PM Find Quote Report
confa
New Member
*


Posts: 3
28 / Male / Flag
Joined: Feb 2010
O.P. RE: Help! Running a file in script folder
no, the second one give an unknown error in "shell.run(MSNexe);" maybe it's because the variable MSNexe is made by another variable (MsgPlus.ScriptFilesPath) and this line want a string of text?
that's just an idea, I'm quite new in scripting xD any suggestion is welcomed ;)

This post was edited on 02-22-2010 at 07:30 PM by confa.
02-22-2010 07:30 PM
Profile E-Mail PM Find Quote Report
pollolibredegrasa
Full Member
***

Avatar
formerly fatfreechicken

Posts: 483
Reputation: 34
35 / Male / Flag
Joined: May 2005
RE: Help! Running a file in script folder
The path contains spaces, so you need to enclose it in quotation marks. Try the following:

jscript code:
var shell = new ActiveXObject("WScript.shell");
var MSNexe = '"' + MsgPlus.ScriptFilesPath + '\\MSN.exe"';
shell.run(MSNexe);


This post was edited on 02-22-2010 at 07:37 PM by pollolibredegrasa.
;p

[Image: chickennana.gif] Vaccy is my thin twin! [Image: chickennana.gif]
02-22-2010 07:35 PM
Profile PM Find Quote Report
confa
New Member
*


Posts: 3
28 / Male / Flag
Joined: Feb 2010
O.P. RE: Help! Running a file in script folder
yeah it works! thanks ;)
another thing: can I export this variable (MsgPlus.ScriptFilesPath) (or MSNexe too) to a txt or any sort of file?
i need this path to be loaded by the batch file ran before (MSN.exe) and if I simply change the script it code will not work anyway :(
02-22-2010 07:53 PM
Profile E-Mail PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
RE: Help! Running a file in script folder
js code:
var FSO = new ActiveXObject("Scripting.FileSystemObject");
var File = FSO.CreateTextFile(MsgPlus.ScriptFilesPath + "\\Path.txt", true);
File.WriteLine(MsgPlus.ScriptFilesPath + "\\MSN.exe");
File.Close();

This post was edited on 02-22-2010 at 08:18 PM by whiz.
02-22-2010 08:18 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On