What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [question] Run commands from script

[question] Run commands from script
Author: Message:
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: [question] Run commands from script
quote:
Originally posted by markee
I think it returns the error because it doesn't like spaces.  I tried a few different things and the only way I got the run command to work was when there was no spaces in th files path (in a file or a folder).  The only way I could imagine getting past this is by using the likes of a *.bat file but I'm sure somone else will divise a better method.

indeed, it definitely doesnt seem to like spaces.
one way around this is to use the short version of the path which can be retrieved by calling Windows API function GetShortPathName.
Example:
code:
var ShortPath = Interop.Allocate((255+1)*2);
Interop.Call('kernel32', 'GetShortPathNameW', Messenger.ReceiveFileDir, ShortPath, 255);
new ActiveXObject('WScript.Shell').Run(ShortPath.ReadString(0));

Or you could just use ShellExecute, which does accept full paths:
code:
Interop.Call('shell32', 'ShellExecuteW', 0, 'open', Messenger.ReceiveFileDir, 0, 0, 1);

EDIT: zomg 2300 posts!

This post was edited on 09-11-2006 at 12:53 PM by Eljay.
09-11-2006 12:48 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[question] Run commands from script - by skorpan on 09-11-2006 at 10:58 AM
RE: Run commands from script - by Felu on 09-11-2006 at 11:00 AM
RE: RE: Run commands from script - by skorpan on 09-11-2006 at 11:12 AM
RE: [question] Run commands from script - by Felu on 09-11-2006 at 11:16 AM
RE: RE: [question] Run commands from script - by skorpan on 09-11-2006 at 11:17 AM
RE: [question] Run commands from script - by Felu on 09-11-2006 at 11:22 AM
RE: RE: [question] Run commands from script - by skorpan on 09-11-2006 at 11:26 AM
RE: RE: [question] Run commands from script - by alexp2_ad on 09-11-2006 at 11:26 AM
RE: RE: RE: [question] Run commands from script - by skorpan on 09-11-2006 at 11:34 AM
RE: [question] Run commands from script - by alexp2_ad on 09-11-2006 at 11:36 AM
RE: [question] Run commands from script - by Spunky on 09-11-2006 at 11:39 AM
RE: RE: [question] Run commands from script - by skorpan on 09-11-2006 at 11:42 AM
RE: RE: RE: [question] Run commands from script - by CookieRevised on 09-11-2006 at 04:15 PM
RE: [question] Run commands from script - by Spunky on 09-11-2006 at 11:44 AM
RE: RE: [question] Run commands from script - by skorpan on 09-11-2006 at 11:48 AM
RE: [question] Run commands from script - by Spunky on 09-11-2006 at 11:49 AM
RE: RE: [question] Run commands from script - by alexp2_ad on 09-11-2006 at 11:51 AM
RE: [question] Run commands from script - by Felu on 09-11-2006 at 12:18 PM
RE: RE: [question] Run commands from script - by alexp2_ad on 09-11-2006 at 12:20 PM
RE: [question] Run commands from script - by markee on 09-11-2006 at 12:19 PM
RE: [question] Run commands from script - by Spunky on 09-11-2006 at 12:31 PM
RE: [question] Run commands from script - by Eljay on 09-11-2006 at 12:48 PM
RE: [question] Run commands from script - by markee on 09-11-2006 at 12:58 PM
RE: [question] Run commands from script - by Shondoit on 09-11-2006 at 06:06 PM
RE: [question] Run commands from script - by CookieRevised on 09-12-2006 at 07:46 AM


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