[question] Run commands from script |
Author: |
Message: |
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
Joined: Aug 2006
|
RE: [question] Run commands from script
Can you not just use
code: strPath = strPath.replace("\\","\\\\");
where strPath is the variable containing the path?
EDIT: Damn, beaten to it again
This post was edited on 09-11-2006 at 11:40 AM by Spunky.
<Eljay> "Problems encountered: shit blew up"
|
|
09-11-2006 11:39 AM |
|
|
skorpan
Junior Member
Posts: 16
Joined: Sep 2006
|
O.P. RE: RE: [question] Run commands from script
quote: Originally posted by alexp2_ad
You actually WANT a double \\ for some reason?
...
code: Messenger.ReceiveFileDir
Returns something like: c:\my documents\my recieved files, right?
This is stored in a string.
Before I can use it with code: Shell.Run
I need to change it into: c:\\my documents\\my recieved files.
How do I do that?
|
|
09-11-2006 11:42 AM |
|
|
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
Joined: Aug 2006
|
RE: [question] Run commands from script
code: strPath = Messenger.ReceiveFileDir;
strPath = strPath.replacE("\\","\\\\");
Shell.Run(strPath);
That should do it.
This post was edited on 09-11-2006 at 11:45 AM by Spunky.
<Eljay> "Problems encountered: shit blew up"
|
|
09-11-2006 11:44 AM |
|
|
skorpan
Junior Member
Posts: 16
Joined: Sep 2006
|
O.P. RE: RE: [question] Run commands from script
quote: Originally posted by SpunkyLoveMuff
Can you not just use
code: strPath = strPath.replace("\\","\\\\");
where strPath is the variable containing the path?
EDIT: Damn, beaten to it again
Thanks alot! =)
I solved it myself just before i read this But you actually did come with help that was useful =)
|
|
09-11-2006 11:48 AM |
|
|
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
Joined: Aug 2006
|
RE: [question] Run commands from script
Hey no problem, although credit should probably goto Alexp2_ad as he got there faster than me
EDIT: My spelling is getting worse
This post was edited on 09-11-2006 at 11:50 AM by Spunky.
<Eljay> "Problems encountered: shit blew up"
|
|
09-11-2006 11:49 AM |
|
|
alexp2_ad
Scripting Contest Winner
Who love the chocolate?
Posts: 691 Reputation: 26
37 / / –
Joined: May 2004
Status: Away
|
RE: RE: [question] Run commands from script
quote: Originally posted by SpunkyLoveMuff
Hey no problem, although credit should probably goto Alexp2_ad as he got therte faster than me
And because you posted a triple backslash first didn't you?
BTW, can anyone get this to work, I tried:
new ActiveXObject('WScript.Shell').run(Messenger.ReceiveFileDir);
But it returns an unknown error, it should work as is, but it doesn't, tried replacing \ or whatever, but it didn't help.
|
|
09-11-2006 11:51 AM |
|
|
Felu
Veteran Member
Posts: 2223 Reputation: 72
30 / /
Joined: Apr 2006
Status: Away
|
RE: [question] Run commands from script
quote: Originally posted by alexp2_ad
new ActiveXObject('WScript.Shell').run(Messenger.ReceiveFileDir);
code: new ActiveXObject('WScript.Shell').run(Messenger.ReceivedFileDir);
Should Work
|
|
09-11-2006 12:18 PM |
|
|
markee
Veteran Member
Posts: 1622 Reputation: 50
36 / /
Joined: Jan 2006
|
RE: [question] Run commands from script
quote: Originally posted by alexp2_ad
BTW, can anyone get this to work, I tried:
new ActiveXObject('WScript.Shell').run(Messenger.ReceiveFileDir);
But it returns an unknown error, it should work as is, but it doesn't, tried replacing \ or whatever, but it didn't help.
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.
EDIT:
quote: Originally posted by -!Felu!-
quote: Originally posted by alexp2_ad
new ActiveXObject('WScript.Shell').run(Messenger.ReceiveFileDir);
code: new ActiveXObject('WScript.Shell').run(Messenger.ReceivedFileDir);
Should Work
alexp2_ad had the correct property, it does not have the extra 'd'
This post was edited on 09-11-2006 at 12:21 PM by markee.
|
|
09-11-2006 12:19 PM |
|
|
alexp2_ad
Scripting Contest Winner
Who love the chocolate?
Posts: 691 Reputation: 26
37 / / –
Joined: May 2004
Status: Away
|
RE: RE: [question] Run commands from script
quote: Originally posted by -!Felu!-
quote: Originally posted by alexp2_ad
new ActiveXObject('WScript.Shell').run(Messenger.ReceiveFileDir);
code: new ActiveXObject('WScript.Shell').run(Messenger.ReceivedFileDir);
Should Work
Nooooooo, I don't like it when people post without checking the scripting docs trying to be a smart arse!
quote: Objects Reference - Messenger
Messenger::ReceiveFileDir
The Messenger::ReceiveFileDir property returns the path of the directory where files copied by Messenger when a file transfer request is accepted are stored.
Syntax
This is a read-only property.
[string] ReceiveFileDir;
|
|
09-11-2006 12:20 PM |
|
|
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
Joined: Aug 2006
|
RE: [question] Run commands from script
quote: Originally posted by alexp2_ad
you posted a triple backslash first didn't you?
Spelling mistake... I knew what I meant to put
<Eljay> "Problems encountered: shit blew up"
|
|
09-11-2006 12:31 PM |
|
|
Pages: (3):
« First
«
1
[ 2 ]
3
»
Last »
|
|