PrimalScript 2009 doesn't process VBScripts

Use this forum to ask questions before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
User avatar
wallacedavis@cox.net
Posts: 6
Joined: Mon Nov 16, 2009 11:30 pm

PrimalScript 2009 doesn't process VBScripts

Post by wallacedavis@cox.net » Tue Nov 17, 2009 12:38 am

I'm attempting to run a VBScript, that did run fine in XP, but, will not in Vista or Windows 7. I'm using PrimalScript 2009 and after running the code below in Debug, I get this error: C:CODEVBScriptEnumerateComputerInfo.vbs(16): Expected identifier.When I run it in the Command prompt, I get this error "Microsoft VBScript runtime error (15, 1) : ActiveX component can't create object: 'Shell.LocalMachine'".Does anyone have an idea where I could go to find out which file isn't register or if I just need to reinstall WSH 5.8 or is there a way to detect which Classes or objects aren't installed? I'm just wondering if there's a corrupted file and/or why these components aren't registered in the first place on Windows 7.


I went ahead and updated the code from Set objComputer = CreateObject("Shell.LocalMachine") TO--------------------------------------------------------------Set objNetwork = CreateObject("WScript.Network")objComputer = objNetwork.ComputerNameWScript.Echo "objComputer"------------------------------------------------------------AND still it doesn't get processed. Now what I also found interesting is that if I precede the code right above with a On Error Resume Next, it will error out on that line as well. So, it appears to possibly be PrimalScript 2009 not doing its job and why that is I don't know yet. I'm using the 45 trial before purchasing. Also, in the Watch window, under a column called Expression, there's an * asterisk. Under a Result column there's nothing, obvously.

Your product looks great and am hoping to purchase after another 42 days but I can't even get it off of the ground.

See original code below.I appreicate your assistance,Wally

Set objComputer = CreateObject("Shell.LocalMachine")


WScript.Echo "Computer name: " & objComputer.MachineName
WScript.Echo "Shutdown allowed: " & objComputer.IsShutdownAllowed
WScript.Echo "Friendly UI enabled: " & objComputer.IsFriendlyUIEnabled
WScript.Echo "Guest access mode: " & objComputer.IsGuestAccessMode
WScript.Echo "Guest account enabled: " & _
objComputer.IsGuestEnabled(0)
WScript.Echo "Multiple Users Enabled: " & _
objComputer.IsMultipleUsersEnabled
WScript.Echo "Offline Files enabled: " & _
objComputer.IsOfflineFilesEnabled
WScript.Echo "Remote connections enabled: " & _
objComputer.IsRemoteConnectionsEnabled
WScript.Echo "Undock enabled: " & objComputer.IsUndockEnabled

User avatar
davidc
Posts: 5726
Joined: Thu Aug 18, 2011 4:56 am

PrimalScript 2009 doesn't process VBScripts

Post by davidc » Tue Nov 17, 2009 2:00 am

It seems that Shell.LocalMachine is not supported on Windows 7 therefore even if you run the script directly it would yield the same results. For further scripting support, I recommend posting on http://www.ScriptingAnswers.com.

Thank you,

David
David
SAPIEN Technologies, Inc.

User avatar
Alexander Riedel
Posts: 6837
Joined: Tue May 29, 2007 4:43 pm

PrimalScript 2009 doesn't process VBScripts

Post by Alexander Riedel » Tue Nov 17, 2009 3:16 am

Well, the folks at scriptinganswers.com sent the user over here because he was wondering if this was a PrimalScript problem. I'll take some time to prepare a reply that hopefully will clear up some of the mystery.

Alex
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
jvierra
Posts: 13302
Joined: Tue May 22, 2007 9:57 am
Contact:

PrimalScript 2009 doesn't process VBScripts

Post by jvierra » Tue Nov 17, 2009 3:31 am

Script is from technet and is marked as XP only in blog post.

http://blogs.msdn.com/gstemp/archive/20 ... 85981.aspx


User avatar
wallacedavis@cox.net
Posts: 6
Joined: Mon Nov 16, 2009 11:30 pm

PrimalScript 2009 doesn't process VBScripts

Post by wallacedavis@cox.net » Tue Nov 17, 2009 6:24 am

What point, besides the Script only works on XP, does this make?
My hope is that someone could point me to a resource that tells me what's deprecated and what's still good with respect to COM Objects
that you can create on Windows 7 or Vista. Or is VBScript just becoming
to outdated that we should now turn to PowerShell?

Please, someone throw me something with some meat. I understand it's probably not PrimalScript. That seems to be clear. I'm looking for some help, not the run-around. It would be most appreciated. In the meantime,
I'll continue to investigate. I nicety would be if PrimalScript had something in place to tell you if COM Objects (or any others) were deprecated and what is to be used in its place. It's probably asking a lot but it sure would save those of us time who haven't been programming for 30 years.

User avatar
jvierra
Posts: 13302
Joined: Tue May 22, 2007 9:57 am
Contact:

PrimalScript 2009 doesn't process VBScripts

Post by jvierra » Tue Nov 17, 2009 6:54 am

This COM object was never made generally available on Xp. It is part of a larger SDK and is used to internally support WIndows logons I believe.

Microsoft has NO documentation that has been officially released. A few bright programmers discovered this objecyt and published how to use it with the note that it will only work on Windows XP.

All of the functions you have used are available via WMI classes. The code you posted was verbatim from the Scripting Guys First Blog.

Post ytour needs back at ScriptingAnswers and someone will point you towards WMI classes that can give you what you need.


PrimalScript is an editor and it is not generally the design of editors to document system objects.

COM can be learned from books on teh subject. WMI is available on all MS platforms and Sapien here has a couple of good books on scripting WMI. I highly recommend them to anyone who needs to seriously script Windows.

OPerating system versions and capabilities are teh responsibility of Microsoft. Microsoft runs hundreds of support forums to answer questions like the ones you are asking.
http://communities.microsoft.com


jvierra2009-11-17 13:58:26

User avatar
wallacedavis@cox.net
Posts: 6
Joined: Mon Nov 16, 2009 11:30 pm

PrimalScript 2009 doesn't process VBScripts

Post by wallacedavis@cox.net » Tue Nov 17, 2009 7:55 am

Hi Jvierra,

As a quick note, I did run the following VBScript in PrimalScript 2009.
----------------------------------------------------------------------------
Set objFSO = CreateObject("Scripting.FileSystemObject")Set colDrives = objFSO.DrivesFor Each objDrive In colDrives WScript.Echo "Drive Letter: " & objDrive.DriveLetterNext
----------------------------------------------------------------------
Keep in mind I've set no breakpoints. When I press F5 to debug, it doesn't run through the process. I have to Step Into the code line by line but it does show Drive letters C, D, E and Z in the Debug window. It's as if PrimalScript wants to process it but there's something preventing it from running. Have I not enabled something. This is on Windows 7. So, I do know it works but why doesn't it run all the way through.

I appreciate the insight and direction. I have the book "Windows 2000 Scripting Guide" which serves a purpose in some areas. It does speak of COM Objects, WMI, ADSI, etc. However, there appears to be a shift and deprecation in some of the objects previoulsy used on XP and prior that appear not to be part of the Vista and Windows 7 OS Structure.

I do appreciate pointing me in the right direction. I'll check out the ScriptingAnswers site and start researching this more thoroughly. I've used your product several years ago, but, now that I'm on Windows 7, there is certainly some changes taking place and I need to come up to speed quickly.

Sincerely,
Wallace Davis

User avatar
Alexander Riedel
Posts: 6837
Joined: Tue May 29, 2007 4:43 pm

PrimalScript 2009 doesn't process VBScripts

Post by Alexander Riedel » Tue Nov 17, 2009 8:43 am

I would suggest to study the manual that comes with PrimalScript 2009 (Help ->PrimalScript Manual). F5 starts the debugger and if you have no breakpoints set it stops at the first instructions.
There are other commands to just run a script.

It really helps to study the manual though.
Alexander Riedel
SAPIEN Technologies, Inc.