Okay....I got it but now how do I keep the cscript cmd window from displaying while the script is running? It is quite annoying. Below is my batch file to call my script and accept the username input. I appreciate anyone who can tell me this as the //B and //Nologo do not keep this from happening. Thanks in advance!
@echo off
REM ======================================================================
REM
REM NAME: Ace Williams
REM
REM
REM COMMENT: Run the MS_Patch_Inventory_Check.vbs Script
REM
REM ======================================================================
REM echo Please the domain/username or machine/username in the entry box...
:: See if I can find myself
If not exist %0 goto ERROR
:: Make the web page
type %0 | find " " | find /v " " | find /v "Not Me!" > %TEMP%\UserIn.htm
:: Make the VBS code
type %0 | find " " | find /v " " | find /v "Not Me!" > %TEMP%\UserIn.vbs
:: Run the vbs code
start /w wscript.exe %TEMP%\UserIn.vbs
:: At this point a batch file "%TEMP%\UserIn.bat" exists and you should
:: call it! If you don't call the batch file here and instead opt to
:: call it from another batch file, be sure NOT to delete it in the
:: "Clean up" code section below!
call %TEMP%\UserIn.bat
REM echo Your user name is %USERNAME%
:: Clean up
REM pause
start runas /profile /env /user:%USERNAME% "cscript \"MS_Patch_Inventory_Check.vbs\" //Nologo"
del %TEMP%\UserIn.vbs
del %TEMP%\UserIn.htm
del %TEMP%\UserIn.bat
goto DONE
:ERROR
cls
goto DONE
:HTML
:: All HTML code MUST be indented exactly four spaces.
:: NOTHING else in this batch file may be indented four spaces.
<html><body><form>Enter Username Example: domain/username or machine/username:
<br><input type=text name=username tabindex=1>
<br><input type=button
language=vbscript name=submit
value=OK onclick='submit.value="Done"'>
</form></body></html>
:VBS
:: All VBS code MUST be indented exactly five spaces.
:: NOTHING else in this batch file may be indented five spaces.
Set fs = CreateObject("Scripting.FileSystemObject")
strFile = fs.GetAbsolutePathName(fs.BuildPath(fs.GetSpecialFolder(2), "UserIn.htm"))
Set web = CreateObject("InternetExplorer.Application")
web.Offline = True
web.AddressBar = False
web.Height = 200
web.Width = 250
web.MenuBar = False
web.StatusBar = False
web.Silent = True
web.ToolBar = False
web.Navigate strFile
Do While web.Busy
Loop
On Error Resume Next
Set doc = Nothing
Do Until Not doc Is Nothing
Set doc = web.Document
Loop
doc.Forms(0).elements("username").focus
web.Visible = True
Err.Clear
Do Until doc.Forms(0).elements("submit").Value <> "OK"
Wscript.Sleep 100
If Err.Number <> 0 Then Exit Do
Loop
strFile = fs.GetAbsolutePathName(fs.BuildPath(fs.GetSpecialFolder(2), "UserIn.bat"))
Set ts = fs.OpenTextFile(strFile, 2, True)
ts.WriteLine "SET USERNAME=" & doc.Forms(0).elements("username").Value
ts.Close
web.Quit

ONE