Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. lewijo

    Progress or status bar when copying files

    I tried out the code myself and it took a little trial and error to make me understand which folder was the source and which was the target. I modified it as shown below to help others. SourceFolder ="P:\UTILS" TargetFolder = "C:\DATA\" Set objShell =...
  2. lewijo

    Adding to the "Right Click" menu

    Here's the code to add the "Command Prompt Here" to the right-click menu. Hope this helps get you started... at least with the part about adding it to the menu. Set objShell = CreateObject("WScript.Shell") objShell.RegWrite "HKCR\Folder\Shell\MenuText\Command\&quot...
  3. lewijo

    Parsing a string for multiple values

    This should do it for you as long as the format is exactly as you described including the parentheses. If the parentheses don't exist, you don't need to the second GageNumber assignment (line right above the Wscript.echo). If the space in front of the "B" doesn't exist either, you'll...
  4. lewijo

    Printing rawdata through VBscript in clients browser

    Here's some code similar to the VB "Open/Print/Close" method but in VBScript. As you can see, it accepts a UNC to the print server's share. It prints unformatted text just like a DOS PRINT. I've used the concept to print mailing labels from an HTML Application (HTA) that accesses an...
  5. lewijo

    Need help with an if statement

    A suggestion that might help you in the future is to use JScript instead of VBScript (blasphemy in a VBScript forum!) You may find it's more akin to C++ in its syntax and ASP pages shouldn't care if you set it up right. I'm more familiar with VB but I've been known to add a little JScript in...
  6. lewijo

    Output to printer

    Depends I guess on what you want to print and to where. I wrote a script that prints mailing labels by writing to a local LPT port using the FileSystemObject. Relative excerpts follow: Set FSO = CreateObject("Scripting.FileSystemObject") Set objPrinter =...
  7. lewijo

    ADSI Help

    Depending on where you put the info in AD would depend on where it is (sometimes), but generally: givenName = First Name initials = Middle Initial sn = Last Name (or surname, thus the sn) This snippet from the sample I referenced above is the key to your request to use the real name to find...
  8. lewijo

    ADSI Help

    I'm baa-aack! Actually we "borrowed" the code from Bill Gates. See: http://www.microsoft.com/technet/treeview/default.asp?url=/technet/ScriptCenter/user/ScrUG145.asp Titled: "Searching for a User Account in Active Directory" Found in Technet,Script Center,Users and Groups.
  9. lewijo

    ADSI Help

    I'm just getting into VBS and ADSI myself, but I've got a couple of observations/hints for you. 1) I don't think you're really accessing Active Directory with the code above. You're talking to your Domain Controller with the GetObject("WinNt://" & strDomain). AD is an LDAP provider...
  10. lewijo

    Reading Lines from Multiple Text files

    Try this: Use the GetFolder method on the folder where the files exist. Loop through the returned GetFolder object with a "For Each... In... Next" loop and pull out the filenames from the Files property of the returned object the GetFolder created. Stick these into your final log...
  11. lewijo

    Is there such thing as a "wait" function?

    From the Windows Script help: Sleep Method Suspends script execution for a specified length of time, then continues execution. object.Sleep(intTime) Arguments object WScript object. intTime Integer value indicating the interval (in milliseconds) you want the script process to be...
  12. lewijo

    Need to manipulate result of reading keys from registry

    You might want to use the Windows Script Host method REGREAD instead of scanreg. It'll return the key-value/value-name for the key you specify into a variable. However, if the key doesn't exist it'll error and you'll to add error checking for each key you search for. Here's a little bit of...
  13. lewijo

    Trying to Query PRINTERS through Active Directory

    I just noticed I didn't really answer your question about what "oPrinter" is. The 'for each oPrinter in oCN' creates a new object called oPrinter that has the properties for each item in the object oCN. So oPrinter.printShareName references the property "printShareName" in...
  14. lewijo

    Trying to Query PRINTERS through Active Directory

    Oops, theres a typo there. It should read oCN.printsharename. Anyways, your question makes me think you need an explanation of what's happening in the script: Set oCN = GetObject("LDAP://OU=Printers,DC=mydomain,DC=com") 'Creates an object called oCN that has all of the items in the...
  15. lewijo

    Trying to Query PRINTERS through Active Directory

    We've just completed something recently regarding what your want to do. Here's some VBS code that will go out and get the all the printers in AD and print them to a file. The LDAP statement will need to be modified to reflect your AD structure. Set oCN =...
  16. lewijo

    Open .pps In PowerPoint not I.E.

    I just found the same situation opening TIF files in IE. The fix is a modification in the registry to change how IE handles specific Active Document types. In your case it's how Powerpoint presentations are handled. See Technet acticle Q162059 "Office Documents Open in Internet...

Part and Inventory Search

Back
Top