OZONE Asylum
Forums
DHTML/Javascript
Help with VBScript
This page's ID:
28417
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
I don't think that would be too hard to do. Do all the computer names have 3 digits before the "labX" and then 4 characters after? If so, you can grab the name of the computer, then parse out the "labX" part, then match it with the printer name. Here is some code that will display the name of the computer. [code] Dim objNet On Error Resume Next Set objNet = CreateObject("WScript.NetWork") Dim strInfo strInfo = objNet.ComputerName MsgBox strInfo 'Destroy the Object to free the Memory Set objNet = Nothing [/code] After you have that, use the "Mid" function to pull out the lab number. [code] strMyString = Mid(strMain, 8, 10) [/code] just pass the computer name to the mid function and tell it where to start and how many characters. [code] strMyString = Mid(strInfo,4,4) [/code] Later, C:\ [small](Edited by [url=http://www.ozoneasylum.com/user/1079]CPrompt[/url] on 09-12-2006 22:44)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »