Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Windows Script Host - VBS not working? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
pingmustard
Newbie
Newbie


Joined: September 13 2010
Online Status: Offline
Posts: 18
Posted: November 07 2012 at 02:11 | IP Logged Quote pingmustard

I'm trying to test some VBS execution within PH, and running into some unhelpful error messages. This is the example call within PH:

ph_runscript_0 (5000, "c:\PH_ASP\ph.vbs", "main()")

it yeilds the output:

Formula Evaluation
     Execution time: 0.109 seconds.
     The formula evaluates to: *** INITIALIZE ERROR - Filename: c:\ph_asp\ph.vbs | Function: main | Source: | Error Number: 0 | Description: | Line: 0 | Column: 0 | Text: ***

The actual content of ph.vbs is fairly simple:

sub main ()
msgbox ("hello world")
end sub

I've verified using cscript.exe that I can execute ph.vbs correctly (adding extra line to call main).

Could someone tell me what I'm doing wrong?   This looks like a trivial task but I've tried changing syntax (removing parenth, converting to functions, etc. ) to no avail.




Back to Top View pingmustard's Profile Search for other posts by pingmustard
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: November 07 2012 at 08:57 | IP Logged Quote dhoward

Ping,

Assuming you're on the 2.1.4 beta, two things to check.

First, make sure that ph_scriptserver.ocx is properly registered with:

regsvr32 c:\powerhome\ph_scriptserver.ocx

Next, make sure that you've enabled the script server to run within PowerHome by navigating in the PH Explorer to PowerHome|Setup|Preferences and verify that "Load Script Server" is checked. Remember if you make a change here, you must reinit or restart for the change to take effect.

Give that a try and let me know.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
pingmustard
Newbie
Newbie


Joined: September 13 2010
Online Status: Offline
Posts: 18
Posted: November 11 2012 at 21:41 | IP Logged Quote pingmustard

Dave, I had to do both your recommendation (OCX reg AND change the PH pref). That fixed the problem ! :)

FYI, maybe this could added to the help file or updated in the error message to be more self helping? I couldn't find any info to figure this out prior (checked help file and online forum).
Back to Top View pingmustard's Profile Search for other posts by pingmustard
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum