Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Computer Model Again

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Computer Model Again
  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 >>
 Computer Model Again - 8/11/2006 12:07:34 AM   
  jonkelly

 

Posts: 7
Score: 0
Joined: 8/1/2006
Status: offline
Folks,
I'm kinda stuck with the return of the Computer Model.

If objItem.model = "HP Compaq DC7100 (xxxx)" Then

The problem i'm having is the XXXX above is the serial number which differs from machine, What i'm hoping to do is for the script to read up as far as "HP Compaq DC7100" leave out the xxxx part so it can make the decision from there. Bascially what i'm doing is automating the installation of drivers for a general xp image.

Any ideas?

Thanks

John
 
 
Post #: 1
 
 RE: Computer Model Again - 8/11/2006 12:12:18 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
Try:

Left()

Example:

MsgBox Left(objItem.model,16) 'outputs: HP Compaq DC7100

_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to jonkelly)
 
 
Post #: 2
 
 RE: Computer Model Again - 8/13/2006 8:42:03 PM   
  ginolard


Posts: 1051
Score: 21
Joined: 8/10/2005
Status: offline
I prefer to use the Split method for this sort of thing.

For example.

ArrayModel=Split("HP Compaq DC7100 (xxxx)","(")
WScript.Echo arraymodel(0)

_____________________________

Author of ManagePC - http://managepc.net
AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm
Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm

(in reply to Snipah)
 
 
Post #: 3
 
 RE: Computer Model Again - 8/13/2006 11:35:04 PM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
You actually didn't need to post this again.  In your first post I posted an example using instr which would have worked.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to jonkelly)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Computer Model Again 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