Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Running MSH scripts?

 
Logged in as: Guest
arrSession:exec spGetSession 2,5,30445
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Windows PowerShell >> Running MSH scripts?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Running MSH scripts? - 1/31/2006 12:49:10 AM   
  mbouchard


Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
I have recently started playing with this, and am having trouble running any of the scripts found here or at the script center, getting Access Denied when I run them as .msh files.  I did a search a while ago and found that there is a regkey that can be changed to fix this, made the change and still can't run em and of course, I can't find that info anymore.  There is a possibility that my PC is the problem as it has slowly been dieing (Don't want to rebuild this one as I am getting a new one soon).

I guess my question comes down to, How do I get a script from teh Script center working?  I have run through the MSH hands on lab that I downloaded with Beta 3 but can't get a stand alone script working.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.
 
 
Post #: 1
 
 RE: Running MSH scripts? - 1/31/2006 7:22:03 AM   
  ebgreen


Posts: 4595
Score: 29
Joined: 7/12/2005
Status: offline
I was having a problem with running scripts and it was an explicit path issue. So, if I am in a directory where the script is I need to type ./Test.msh to run the script not just Test.msh.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to mbouchard)
 
 
Post #: 2
 
 RE: Running MSH scripts? - 1/31/2006 7:48:47 AM   
  mbouchard


Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
hmm, nope, tried that and still not working.  Some more strange behavior, if I try to edit the msh file (right click/edit) I get access denied.  I took a look at the settings under file types and Notepad is set for both open and edit.    Will need to install MSH support on another pc and check it out.

Also, from a cmd line if I do msh test.msh or msh -command test.msh I get a test.msh not cmdlet error.

I guess I just need to read more.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: Running MSH scripts? - 1/31/2006 7:56:38 AM   
  ebgreen


Posts: 4595
Score: 29
Joined: 7/12/2005
Status: offline
Try msh -command ./test.msh from a command prompt.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to mbouchard)
 
 
Post #: 4
 
 RE: Running MSH scripts? - 2/1/2006 12:39:25 AM   
  mbouchard


Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
Ahh that worked.  Thanks.  Why the need for ./?

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to ebgreen)
 
 
Post #: 5
 
 RE: Running MSH scripts? - 2/1/2006 2:00:23 AM   
  crazymatt

 

Posts: 287
Score: 0
Joined: 3/4/2005
From:
Status: offline
Strange that just ./script.msh dont work from inside msh-shell for you.

well i think the ./ is needed because .msh isnt a registered filetype and there is no assosiation with it or the path u running the script from isnt in your %path%, but i can be wrong there.
anyway ./ just means "current directory"

< Message edited by crazymatt -- 2/1/2006 2:45:56 AM >


_____________________________

-There is only 10 sorts of people, those who understand binary and those who dont.

(in reply to mbouchard)
 
 
Post #: 6
 
 RE: Running MSH scripts? - 2/1/2006 3:51:29 AM   
  ebgreen


Posts: 4595
Score: 29
Joined: 7/12/2005
Status: offline
I believe it is a security feature so that someone couldn't just put some maliscious code on your machine in a file named Dir.msh then it would run the next time you try to do a Dir command.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to crazymatt)
 
 
Post #: 7
 
 RE: Running MSH scripts? - 5/5/2006 8:19:48 AM   
  mcds99


Posts: 407
Score: 4
Joined: 2/28/2006
Status: offline
I could be totally wrong but I'll give it a whirl...

The  ./ is a left over from shell scripting (bash I think) it has been many years

googling.........

see http://linuxcommand.org/wss0020.php#bashrc

under "Shell functions"

It's not a great explanation but it might throw some light on the subject.

If you go out to google and search for /. or ./ you will get a blank result.


(in reply to ebgreen)
 
 
Post #: 8
 
 RE: Running MSH scripts? - 5/6/2006 4:11:30 AM   
  ebgreen


Posts: 4595
Score: 29
Joined: 7/12/2005
Status: offline
From the Power Shell docs, the .\ or ./ is required because the current working directory is not part of the path.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to mcds99)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Windows PowerShell >> Running MSH scripts? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts