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 strongm 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. Strahan

    Using OnClick event on a Submit Button

    Yea, it wouldn't be possible but you can do something like onclick=formname.sessiondata.value='blah' then have a hidden text field named sessiondata. When you run the form action script, have it evaluate sessiondata and if it's not null, then you have to set your session variable. That's how...
  2. Strahan

    Mass change letters in filename

    Hehe, boy I'm an idiot. I forgot about replace :)
  3. Strahan

    Type Mismatch Error 'Session' Microsoft VBScript runtime error '800a00

    Please post the code section that the error is occuring in. A few lines before and after, not just the failing line. Thanks.
  4. Strahan

    Launching IE from a login script

    Well, easiest thing would be to throw it in a logon script. You could do it in a batch file as something like: if exist "%systemdrive%\program files\internet explorer\iexplore.exe" "%systemdrive%\program files\internet explorer\iexplore.exe" http://www.google.com" But...
  5. Strahan

    Mass change letters in filename

    While this may not be the "best" way, this is how I'd do it. I know looping within a loop is generally slow and to be avoided but it runs fast on my box and I couldn't think of a better/easier way. Just set the ProcessFolder var to the folder with the munged files. The Replace var...
  6. Strahan

    Getting Remote users IP

    Oh yea, if you want to snag the IP info of a remote system, that is to say run it from your box and get the IPs of another, where it has: Set WMI = GetObject("winmgmts:" & "!\\.\root\cimv2") Replace the . in !\\.\ with the name of the PC to scan.
  7. Strahan

    Getting Remote users IP

    You could also use WMI if the workstation supports it (2k/xp/2k3). If it doesn't, you could push WMI to it. I'd recommend that, because WMI is nice to have available :) ------------------------------------------------------- Set WMI = GetObject("winmgmts:" &...
  8. Strahan

    Install a hotfix remotely?

    No prob. Just remember to clean up those temp batch files. I forgot during one push awhile back and I still come across machines with batches in root from it, hehe. A newer version of psexec may be out that fixes the quirk with parms that'd make the bat unnecessary. I haven't checked lately.
  9. Strahan

    How excecute a command as administrator ?

    Hmmm. Are you referring to scripts that run somehow specially? Because if you just do start, run, wscript script.vbs it runs as you I thought. At least, that's what username is displayed when you view taskmgr to see who owns which processes.
  10. Strahan

    I'm trying to write a small VBscrip

    Here is how I could write this: ----------------------------------- Set SH = CreateObject("WScript.Shell") Set FS = CreateObject("Scripting.FileSystemObject") BatchFile = "h:\test\gWdataXP.bat" OutputFile = "H:\Test\FTPWEBLOG.TXT" FindString = "226...
  11. Strahan

    Execute a batch file

    Set SH = CreateObject("WScript.Shell") SH.Run "%comspec% /c drive:\path\batchname.bat", 0, true Set SH = Nothing This will launch it in the background and pause script execution while it runs. To see the window as it runs change 0 to 1. To let the script continue while...
  12. Strahan

    runas command to modify system path

    Can't you just shell it? Set SH = CreateObject("WScript.Shell") SH.Run "%comspec% /c %systemroot%\system32\runas.exe /user:domain\username blah blah blah..."
  13. Strahan

    Install a hotfix remotely?

    Shell to psexec.exe from www.sysinternals.com to fire it off from a remote PC. PSexec starts a process on a remote box. I've seen some issues when it tries to use something with parameters, so usually what I do is create a temp bat file on the c:\ then have something like: @echo off...
  14. Strahan

    updating dynamic select menu in hta without submitting form

    I use <DIV> tags to do this. I have a webpage for people to configure what printer to use for another app.. they pick the print server from a dropdown then it dynamically updates the second dropdown for printer. Here's an example. <script language=vbscript> Function updatedrop() if...
  15. Strahan

    how do I count the number of times a word or string appears in a file?

    You can save quite some time by not doing .readall and rather doing a read by bytes. 4GuysFromRolla did a review on this, the read all time to parse a meg file was 73.56 seconds versus 0.28 seconds with read :) http://www.4guysfromrolla.com/webtech/010401-1.shtml
  16. Strahan

    Requesting user input for password - display *'s not text

    The way I usually do it is using IE to handle the input. Not actually run the code in IE, just use IE itself to process the input. Here's an example snippet from one of my scripts which uses IE to gather user input: --------------------------------------------------- Set IEX =...
  17. Strahan

    Launching Terminal Services from IE

    You could do something akin to this: <script language=vbscript> function ts_connect() set sh = createobject(&quot;wscript.shell&quot;) sh.run &quot;%systemroot%\system32\mstsc.exe /v:&quot; & data.ip.value set sh = nothing end function </script> <form name=data> IP/System to connect...
  18. Strahan

    determine system manufacturer/model

    Yup, using WMI: SystemName = &quot;machine-to-check&quot; set tmpObj = GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\\&quot; & SystemName & &quot;\root\cimv2&quot;).InstancesOf (&quot;Win32_ComputerSystem&quot;) for each tmpItem in tmpObj MakeModel = trim(tmpItem.Manufacturer) &...
  19. Strahan

    scripting syntax error, W2K server

    You forgot an & after the first objArgs(1). Also, it's organiZational unit :) There are some other changes i'd make as well. I prefer to avoid shelling out whenever possible. In order to achieve that goal, I'd use the FileSystemObject to do the copying and deleting. For the share, I'd use...
  20. Strahan

    Printing emails through vbscript

    Hi. I wrote an application to allow printing from my companies Blackberries. You forward the email from the BB to a special email addy, my script then pops that mailbox and when it sees a msg it prints it. The first line of the email tells it where to print to. Problem is, this works great...

Part and Inventory Search

Back
Top