Source language: Translate to:

PCinfo, a little helper tool

Share sample pubs, scripts, etc. with other NeoBook users

Moderator: Neosoft Support

PCinfo, a little helper tool

Postby Light » Fri Sep 19, 2008 10:17 am

When someone have a computer related problem, the people
that is going to solve the problem will (most likely) need to
know som basic information about the PC.
This basic information included in this pub is :

- What version of window
- Central Prosessing Unit CPU(s)
- Graphic card(s)
- How much memory (Ram)

All this information is added to the Text Entry textbox.
Since this is a textbox you can easilly add more information
if needed and then copy the text into the clipboard for easy
pasting into mail program or forum or ..whatever
Have fun :)


It would be nice if people with multiple cpu's and/or multiple
graphic cards could post their result here. The function should
detect all the graphic cards / cpu's and display the info about them.
Unfortunately I don't have access to such machines, so I cant test it.
Thank you


Example 1

Microsoft® Windows Vista™ Home Premium
Service Pack: 1.0

CPU Name: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
Number Of Cores: 4
Number Of Logical Processors: 4

Graphic Card Name: NVIDIA GeForce 8800 GT
VideoRam: 512 MB
Current Video Mode: 1280 x 1024 x 4294967296 colors

Total Memory: 3,25 GB

Here you can add your own text


Example 2

Microsoft Windows XP Home Edition
Service Pack: 3.0

CPU Name: Intel(R) Pentium(R) 4 CPU 3.00GHz
Number Of Cores: 1
Number Of Logical Processors: 2 <--(Added manually : 2 indicate that Hypertreading is active and could be the source to the problem)

Description: NVIDIA GeForce 7600 GS
Name: NVIDIA GeForce 7600 GS
VideoRam: 256 MB
Current Video Mode: 1152 x 864 x 4294967296 colors

Total Memory: 1 GB

Here you can add your own text
My hardrive is burning. Is that bad ?


_____________________________________________________________

This pub consist of 2 files

1) The pub
2) A function : PCinfo. (This is a VBscript file and should reside inside the VBScript Examples folder.)

You can use this : http://www.neosoftware.com/forum/viewtopic.php?t=16340
to get this pub into Neobook.

Create a new function (VBscript) in NeoBook and call it PCinfo.
Cut the Function text from this forum and paste it in to the
function PCinfo in NeoBook.



PUB :
Code: Select all
NBW Publication Source File
(C)1993-2008 NeoSoft Corp.
Title=PCinfo
Language=US
NeoBookVer=5,60
ScreenColors=16777216
ScreenWidth=640
ScreenHeight=480
BkndColor=0
ScreenAutoSize=Yes
LinkColor=16711680
WindowStyle=0
WindowOrder=0
WindowPos=0
WindowProps=29
BiDiMode=0
UseUpdateTimer=Yes
ReturnTime=60
StartupAction=Call "VBScript Examples\PCinfo" "[PCinfo]"
ShapeTransColor=536870912
CompressPub=Yes
CompiledName=C:\Users\Me\Documents\Neo\v5 Samples\Mine Pubs\PCinfo\PCinfo.exe
CompileType=0
MediaType=0
FilesIncluded=1
FontsIncluded=2
FontsToCompile=|
CopyExternalFiles=No
SetupMedia=3
SetupInstDir=C:\MyProgram
SetupTitle=Setup
SetupColors=16711680|0|65535
Variables=[PCinfo]¶
VersionMajor=1
VersionMinor=0
VersionRelease=0
VersionBuild=0
CustomFontName=Arial
CustomFontSize=9
CustomFontStyle=0
CustomCharset=1
CacheSize=30
ExtractOp=132
L_OK=OK
L_CANCEL=Cancel
L_YES=Yes
L_NO=No
L_CLOSE=Close
L_ERRORTITLE=Error
L_FINDTITLE=Find
L_FINDPROMPT=Find &What
L_FINDFIRST=&Find First
L_FINDNEXT=Find &Next
L_FINDERROR=Search text not found.
L_PWORDTITLE=Password required
L_PWORDMSG=Before continuing, you must first|enter the correct password.
L_PWORDPROMPT=&Password:
L_PWORDERROR=That's not the right password!
L_MEDIAERROR=In order to play this type of file you must install|the appropriate multimedia hardware and/or|software.
L_INTERNETERROR=Unable to locate Internet Browser software.
L_ABORTFUNCTION=Do you want to cancel this function?
L_EXTRACTERROR=This file could not be extracted and cannot be played.
L_INSTDIRPROMPT=Please enter the drive and directory where you would like this program to be installed. To accept the default drive and directory, simply press Enter.
L_INSTFOLDERPROMPT=Do you wish to create a program folder?
L_INSTRUNPROMPT=Do you want to run
L_INSTDISKPROMPT=Please insert disk #
L_INSTDISKERROR=That's not the correct disk, try again.
L_INSTGENERROR=The installation has terminated.
L_INSTEXITPROMPT=Do you really want to cancel the installation?
L_INSTWINTITLE=Setup
L_INSTPROGTITLE=Extracting Files...
L_SENDEMAIL=Sending Mail...
L_MAILSERVER=Please enter the name of your outgoing email server:
L_COPY=Copy to Clipboard
L_SELECTALL=Select All
L_DONWLOADFILE=Downloading: %s
L_PLEASEWAIT=Please wait...
MasterPage
NewPage=New Page
PageStyle=1
PageColor=16777215
PageGradient1=8976536
PageGradient2=20512
PageGradientDir=1
WallpaperStyle=0
EffectSpeed=0
ObjectType=9
Name=TextEntry1
X=10
Y=115
W=616
H=312
Anchor=0
Text=¶¶¶¶¶¶¶                                                            Please wait :)
VarName=[PCinfo]
EditMultiLine=Yes
EditLen=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=8421376
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=65535
TabOrder=2
ObjectType=3
Name=PushButton1
X=536
Y=440
W=89
H=33
Anchor=0
Text=E^xit
Align=2
Key=32856
ImageStyle=0
XPTheme=Yes
ObjAction=Exit "" ""
LineColor=0
LineWidth=1
LineStyle=0
FillColor=8421376
FillPattern=0
Font=Arial
FontSize=10
FontStyle=1
FontCharset=1
TextColor=0
TabOrder=3
ObjectType=8
Name=Text1
X=3
Y=9
W=632
H=46
Anchor=0
Font=Comic Sans MS
FontSize=10
FontStyle=0
FontCharset=0
TextColor=65535
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset0 Comic Sans MS;}}{\pard{\qc\li0\fi0\ri0\sb0\sl\sa0 \plain\f1\fs36\cf0\b Easy Info}}}
HMargin=4
VMargin=4
LineColor=0
LineWidth=1
LineStyle=0
FillColor=5273600
FillPattern=0
TabOrder=4
ObjectType=3
Name=PushButton2
X=202
Y=68
W=260
H=35
Anchor=0
Text=Send to ^Clipboard
Align=2
Key=32835
ImageStyle=0
XPTheme=Yes
ObjAction=SetVar "[Clipboard]" "[PCinfo]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=8421376
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=5
ObjectType=3
Name=PushButton3
X=22
Y=429
W=47
H=45
Anchor=0
Text=?
Align=2
ImageStyle=0
BevelWidth=0
ObjAction=AlertBox "Easy Info Help" "When you have a computer related problem, the people|that is going to help you will (most likely) need to know som basic|information about your PC.||This basic information included here is :||- What type of window|- Central Prosessing Unit CPU(s)|- Graphic card(s)|- How much memory (Ram)||All this information is added to the Text Entry textbox.|Since this is a textbox you can also add more information|if needed and then copy the text into the clipboard for easy |pasting into mail program or forum or fax program or ..whatever||Have fun :)"
LineColor=0
LineWidth=0
LineStyle=0
FillColor=8421376
FillPattern=1
FillMode=Yes
Font=Comic Sans MS
FontSize=26
FontStyle=1
FontCharset=1
TextColor=255
TabOrder=6


EDIT
Moved the text FUNCTION PCinfo outside the code section
Changed videoram = objItem.AdapterRAM & vbCrLf into videoram = objItem.AdapterRAM


FUNCTION PCinfo
Code: Select all
{NeoBook Function}
Version=5,60
Language=VBScript
Param=[%1]|Variable|Get info about Cpu(s) and graphic card(s)
{End}
' Get info about Windows,Cpu(s) and graphic card(s)

Dim txt, ram, ramMBGB, videoramMBGB, videoram


On Error Resume Next
' ******************************** Windows ***************************************************************
' List Operating System and Service Pack Information
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objOS in colOSes
     txt=txt &  objOS.Caption & vbCrLf 'Name
     txt=txt &  "Service Pack: " & objOS.ServicePackMajorVersion & "." & objOS.ServicePackMinorVersion & vbCrLf& vbCrLf
Next

' ********************************  CPU  ***************************************************************
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor",,48)

For Each objItem in colItems
   txt=txt & "CPU Name: " & objItem.Name & vbCrLf
   txt=txt & "Number Of Cores: " & objItem.NumberOfCores & vbCrLf
   txt=txt & "Number Of Logical Processors: " & objItem.NumberOfLogicalProcessors & vbCrLf& vbCrLf
Next

'************************************** VIDEO ***********************************************************
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery _
    ("Select * from Win32_VideoController")

For Each objItem in colItems
   ' txt=txt & "Description: " & objItem.Description & vbCrLf
    txt=txt & "Graphic Card Name: " & objItem.Name & vbCrLf

    videoram = objItem.AdapterRAM
    videoram = (videoram / 1024)/1024
if  videoram  > 1000 then
     videoram  =  videoram  /1024
    videoramMBGB = " GB"
        else
    videoramMBGB = " MB"
end if
    txt = txt & "VideoRam: " & videoram & videoramMBGB & vbCrLf

    txt=txt & "Current Video Mode: " & objItem.VideoModeDescription & vbCrLf& vbCrLf
 Next

'************************************** List Total RAM **************************************************************
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colCSItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
For Each objCSItem In colCSItems
  ram =   objCSItem.TotalPhysicalMemory
Next
ram = (Ram / 1024)/1024

if ram > 1000 then
    ram = ram /1024
    ramMBGB = " GB"
        else
    ramMBGB = " MB"
end if

txt=txt & "Total Memory: " & Round(ram,2) & ramMBGB& vbCrLf& vbCrLf

'************************************** END: List Total RAM **************************************************************






publication.nbSetVar "[%1]", txt

' WScript.Echo (txt)
Last edited by Light on Fri Sep 19, 2008 2:44 pm, edited 2 times in total.
Light
 
Posts: 38
Joined: Tue Nov 27, 2007 7:47 am

Postby Neosoft Support » Fri Sep 19, 2008 10:18 am

Very cool!

Would you like to add your pub to the NeoBook Resource Center?

http://www.neosoftware.com/neobook/
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby Light » Fri Sep 19, 2008 10:55 am

Neosoft Support wrote:Very cool!

Would you like to add your pub to the NeoBook Resource Center?

http://www.neosoftware.com/neobook/


Shure. That would be nice :)
Light
 
Posts: 38
Joined: Tue Nov 27, 2007 7:47 am

Postby bunker » Sat Sep 20, 2008 12:13 am

Hi... I get a Invalid Character error :roll: running on XP sp3
User avatar
bunker
 
Posts: 141
Joined: Sat Sep 29, 2007 4:00 pm

Postby Light » Sat Sep 20, 2008 7:02 am

bunker wrote:Hi... I get a Invalid Character error :roll: running on XP sp3




Try this :

1) Copy the pub from the forum into Neobook
2) In NeoBook press F11 and select VBScript Examples
3) Click New and select VBscript
4) Copy the function from the forum and past it into NeoBook
5) Click floppy disk icon top left (Export Text)
6) Type PCinfo and save
7) Bottom right : Click Cansel
8 ) Click Yes to Abandon..
9) Click close
10) Press F9

It would be nice if you tell me if it worked...
Light
 
Posts: 38
Joined: Tue Nov 27, 2007 7:47 am

Postby bunker » Sat Sep 20, 2008 8:43 pm

Thanks ... I followed your steps and it works. :D

What we do not understand is the mistake because I think have well added the function manually :roll: .

Greetings
User avatar
bunker
 
Posts: 141
Joined: Sat Sep 29, 2007 4:00 pm

Postby Light » Tue Sep 23, 2008 1:24 am

bunker wrote:Thanks ... I followed your steps and it works. :D

What we do not understand is the mistake because I think have well added the function manually :roll: .

Greetings


You are welcome :)

You could also try this :

1) Copy Function from forum.
2) Open Notepad and paste the Function in to it.

3) Remove the space after {NeoBook Function} <---- This one and nothing else.

4) Save the Function in \NeoBook 5\Functions\VBScript Examples and name it PCinfo.
5) On my system the .txt is added so it looks like this : PCinfo.txt ....Remove the .txt so you end up with only PCinfo.
6) Make shure you have the pub loaded in NeoBook, then press F9.
Light
 
Posts: 38
Joined: Tue Nov 27, 2007 7:47 am

Postby Light » Wed Sep 24, 2008 12:02 am

Light
 
Posts: 38
Joined: Tue Nov 27, 2007 7:47 am


Return to Sample NeoBook Pubs

Who is online

Users browsing this forum: No registered users and 1 guest