IP Resolution
Is there a function to have an IP address resolved to the workstation name?
Thanks in advance Tag: Script to create COM+ application Tag: 143003
vbscript that moves files that are older than 3 days
I need a vbscript that moves files that are older than 3 days
I am having problems writing this script
I f someone could help I would appreciate it
Thanks
Earl L Tag: Script to create COM+ application Tag: 143002
Running Script with Elevated Rights
I have a VB script which detects the OS version, installs the latest RPC
patch, and opens an IE window telling the user they have been updated and
need to re-boot the system to "activate" the patch. I am pushing this task
with SMS and all is fine.
The problem is I have a significant number of users who are not SMS clients
and do not have Admin Rights on the local machine. I am trying to get the
script to run with elevated rights when manually invoked by the user and
having no success (I want to email a link to the script which says "Click
here to update your system").
Anyone have any words of wisdom on this task? I appreciate any and all
comments (unless they are nasty).
Thanks,
Russ J Tag: Script to create COM+ application Tag: 142999
Printer Help
I use a VBScript for each user in their login script that maps a
specific network printer in the room where they are logging in.
This script uses the computer name to determine the specific printer.
This script work with Windows 2000 pro, and XP Pro.
Here is the problem;
I have 4 users accounts that it will not work and I just
cant figure out why. It appears to be a permissions issue
when the login script runs and the script throws this error.
Cscript Error: Loading your settings failed. (Access is denied.)
I have deleted the 4 users and recreated them, still they fail.
I know this script works, other users it works fine under both OS's
My questions are what specific permissions are required to run a
vbscript? Is the script failing because the u ser doesnt have the
right permissions to run it? Or, is it failing to make the changes
that the script is trying to change? ( ie; add the network printer)
Here is a snippet of the script
Option Explicit
DIM RegEntry, ComputerName
RegEntry="HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName"
ComputerName = ReadRegValue(RegEntry)
if InStr(1,ucase(ComputerName),"xpfinal",vbTextCompare) > 0 then call
SetPrinter("\\XXXX\test-1")
if InStr(1,ucase(ComputerName),"ms-a3-",vbTextCompare) > 0 then call
SetPrinter("\\XXXX\Test-2")
if InStr(1,ucase(ComputerName),"ms-a4-",vbTextCompare) > 0 then call
SetPrinter("\\XXXX\Test -3")
'so on and so forth.
wscript.quit
' *** This subroutine installs and sets the default printer
Sub SetPrinter(ByVal PrinterPath)
DIM WshNetwork
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection(PrinterPath)
WshNetwork.SetDefaultPrinter Printerpath
end sub
' **** This function returns the data in the registry value
Function ReadRegValue(ByVal RegValue)
DIM WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
ReadRegValue=""
On Error Resume Next
ReadRegValue= WSHShell.RegRead(RegValue)
End Function
I call this script from the logon.bat for each user;
@echo off
Cscript %LOGONSERVER%\netlogon\roaming.vbs
net use g: \\XXXXX\XXXX
The printer configurations are properly setup on the server and the
shares are correctly named. I didn't assign any specific permissions
to the printer shares. They work for hundred of other accounts.
When the users that the script fails on, try to add the network
printer via the wizard this fails too.
HELP
Robert Tag: Script to create COM+ application Tag: 142996
Change computername automatically
Hi there,
I am looking for a working script or small utility to change the Windows XP
computername immediately after start-up, if required, before any user logs
on. This script/utility should check if the current computername equals
VSxxxxxxxxxxxx (where x = macaddress) and if not, change it accordingly
without breaking domain membership or other security issues. The latter is
the problem. I have found and tried several scripts, however there is always
a domain/security problem.
Is there a 100% transparent and functional way to achieve the above?
Thanks,
--
SLE Tag: Script to create COM+ application Tag: 142995
Search for a specific file on local drives
I'm looking for a script that will search for a specific file by name on all
local drives and return the path. I've seen several examples that search
for files by extension, date, and file size but none that just searches for
a specific file. Can someone please help?
Thanks,
Todd Ouimet
touimet@advantageprofessionals.com Tag: Script to create COM+ application Tag: 142994
how to get the infromation if it's a string or a decimal
please help!
in my script i'm getting data from an csv file and split the values to
an aray. now i'd like to claculate with some values, but it's still
possible that there are strings als value. now i'd like somthing like
that:
for i = 1 to ubound(array)
if array(i) = nuberic then calculate something.
next i
how can i do that numberic function?
thx
christian Tag: Script to create COM+ application Tag: 142990
* Newsgroup doc. and 7199 Tips, Tricks, and Registry Hacks - 15-Sep-2003 05:30.22 *
15-Sep-2003 05:30.22.
Please see the Microsoft Newsgroups page at
http://communities.microsoft.com/newsgroups/default.asp
Visit Windows & .NET Magazine's 7199 tips at http://www.jsiinc.com - press the
"Tips & Tricks" button.
Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com Tag: Script to create COM+ application Tag: 142985
RegExp not working
Below is a code to match Meta Tags. The pattern is found twice but I
am not able to print the first match. The second match displays
correctly. If I add a space before the first 'meta' keyword then it
works.
Can anyone spot a problem here? Any help would be appreciated. Thanks.
Vilva
-----------------------------------------------------------
<%
Function ShowMetaTags(HTMLstring)
Set re = New RegExp
With re
.Pattern = "<\s*META[^>]*>"
.IgnoreCase = True
.Global = True
End With
Set aMetaMatch = re.Execute(HTMLstring)
Response.Write "Count: " & aMetaMatch.count
Response.Write "<BR>"
Response.Write "First Tag: " & aMetaMatch(0).Value & "----" &
aMetaMatch(0).FirstIndex & "---" & aMetaMatch(0).length
Response.Write "<BR>"
Response.Write "Second Tag: " & aMetaMatch(1).Value & "----" &
aMetaMatch(1).FirstIndex & "---" & aMetaMatch(1).length
Set re = nothing
End Function
%>
<%
ShowMetatags "<meta FOO=""bar"" NAME =""DateCreated ""
cONtenT=1999.11.24 >< META NAME = ""AuthorName"" CONTENT="" George
Young"">"
%>
--------------------------------- Tag: Script to create COM+ application Tag: 142983
run .vbs as a .exe?
Hi,
I am in this environment:
WIN2K, SP3, with a Domain Controller.
Currently, the executing of .vbs is controlled by setting
Local Group Policy-User Configuration-System-Run only allowed Windows
Application (with Apply Group Policy set) - wscript.exe
I would like to know:
a) Instead of placing the source-code in the server, can I create a
.exe and place it in the server instead. If so, how can I do that?
I would like to do this so as to control the access to the script.
b) Instead of signing the .vbs script, is there other way to restrict
access to executing of all .vbs script? I would like to allow
executing of only certain .vbs script instead of open for all.
Robin
--
Posted via http://dbforums.com Tag: Script to create COM+ application Tag: 142982
display text field at run time
I want to display credit card fields when the user selects the option paid
membership. If user selects the option free membership, then the credit card
text field will disappear. Here's the code I did with JavaScript but didn't
work.
> <SCRIPT LANGUAGE="JavaScript">
> function generateCreditTextField()
> { if (document.myform.membership.value == "1")
> { alert('free');
> document.write("");
> }
> else
> { alert('paid');
> document.write("<P>Credit Card: <input type="text"
name="credit")</P>");
> }
> }
> </SCRIPT>
>
> <form name="myform">
> <select name="membership" onchange="generateCreditTextField()">
> <option></option>
> <option value="1">Free Membership</option>
> <option value="2">Paid Membership</option>
> </select>
> </form>
>
> please advise! Thanks!
> John
>
> Tag: Script to create COM+ application Tag: 142980
security updates
I installed security updates and now i cant run aspx
pages on server. I get
Server Application Unavailable
The web application you are attempting to access on this
web server is currently unavailable. Please hit
the "Refresh" button in your web browser to retry your
request.
Administrator Note: An error message detailing the cause
of this specific request failure can be found in the
system event log of the web server. Please review this
log entry to discover what caused this error to occur.
can someone help???
thanks in advance Tag: Script to create COM+ application Tag: 142969
reading from excel in vbscript
I would like to read 5 different columns in an excel spreadsheet with
vbscript.
Can anyone please help me with a head start snippet.
Thank you,
Juan Tag: Script to create COM+ application Tag: 142968
display text field dynamially
I want to display credit card fields when the user selects the option paid
membership. If user selects the option free membership, then the credit card
text field will disappear. Here's the code I did with JavaScript but didn't
work.
<SCRIPT LANGUAGE="JavaScript">
function generateCreditTextField()
{ if (document.myform.membership.value == "1")
{ alert('free');
document.write("");
}
else
{ alert('paid');
document.write("<P>Credit Card: <input type="text" name="credit")</P>");
}
}
</SCRIPT>
<form name="myform">
<select name="membership" onchange="generateCreditTextField()">
<option></option>
<option value="1">Free Membership</option>
<option value="2">Paid Membership</option>
</select>
</form>
please advise! Thanks!
John Tag: Script to create COM+ application Tag: 142965
Windows PE Wscript.shell run issues
Hi,
I have a RIS build which boots to windows PE, calls a HTA (to get build
details) then based on those options, starts a 2003 or XP build.
The problem i am having is with diskpart. When calling a vbs using
WSHShell.run "Diskpart /s Z:\build\diskwork1.txt", 1, True
The disk is partitioned and all is fine.
When however calling this command from within the HTA, i get nothing. I
would like to keep it within the one file if possible - anyone have any
ideas? Tag: Script to create COM+ application Tag: 142962
Script Question
I have a situation where I need to deploy SP4 and MS03-026 & 039 to several
workstations. In this particular environment, the company has not
implemented AD. The only OU's present are those created by default during
dcpromo. I've tried to convince them to implement AD but I may as well be
talking to a wall. Also, I'm unable to use SMS, SUS (no good for SP4 and
they won't consider it for hotfixes), or AD to deploy the service pack and
hotfixes.
Earlier today, I ran across KB 827227
http://support.microsoft.com/default.aspx?kbid=827227 . I believe it would
be possible to modify this script to deploy SP4 prior to the hotfixes
however, I'm not 100% certain how it would be accomplished and I've never
used VBScript.
Does anyone know how to modify this script to deploy SP4 first then the
hotfixes or know of any other method I could use to deploy SP4 and the
hotfixes rapidly? Tag: Script to create COM+ application Tag: 142946
Convert WMI Date
Excuse my ignorance but is there an easy way to convert the date returned by
the CIM_Datafile class into a readable format, i.e.?
objFile.LastAccessed returns 20030914074104.750000-420 Tag: Script to create COM+ application Tag: 142945
Script question ?
Hi, I'm thinking the problem here is that Documents and Settings
contains spaces, does anyone have a fix for this. I'm sure it's
simple I'm just new to scripting.
XP
Thanks
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFolders = objWMIService.ExecQuery _
("Select * from Win32_Directory where Name = 'C:\\Documents and Settings
\Atl-2K\Favorites\'")
For Each objFolder in colFolders
errResults = objFolder.Delete Tag: Script to create COM+ application Tag: 142944
DOS
Hello
I work with Focus at work under W98. Focus is a very old DOS database
program. I have to do much typing there so I thought a small script with '
Sendkeys' could help me. But the Focus screen does not accept what I send.
Is there a way around ?
Many Thanks.
A.Geeraert Tag: Script to create COM+ application Tag: 142941
browser reload from external script
Hello!
does there exist a solution for my problem?
Following situation:
I start the internet explorer with a VBS script on a Win XP Machine with
following code. The script is calles "start_ie.vbs"
########
Set wshell = CreateObject("Wscript.shell")
wshell.run "iexplore.exe"
########
I execute the script and the browser window opens.
Now is it possible to reload the browser by executing a second script
for example called "reload.vbs" ??
I do not know how to obtain the object Id from the running browser instance.
Pleas help me...
Thanks a lot
Georg Tag: Script to create COM+ application Tag: 142939
Getting the output of a stored procedure in a VBScript
I am running a stored procedure that needs parameters through a VBScript and
I need to know to get the output from that procedure to a variable in the
script.
Here is how am I calling the stored procedure:
Dim cnn
Set cnn = CreateObject("ADODB.Connection")
cnn.Open "Provider=SQLOLEDB;Data Source=myServer;Initial
Catalog=myDB;Integrated Security=SSPI;Persist Security Info=False;"
cnn.Execute "exec execute_job_with_return 'base' ,'00020' ,5 ,'ubi' ,'UC',
'loyalty' , 0, '000' , lty_rmmeltest ,'smart' ,'%DATA%\txn TEST.txt',' ' ,
'Y' ,NULL"
The stored procedure then returns an integer value (named "runid") which i
need to use for further operations.
Thanks in advance. Tag: Script to create COM+ application Tag: 142938
script question
I created a form to calculate the sum of 2 text fields with JavaScript,
but it doesn't display the result after execute. here's the code,
please advise!
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function sum(x, y)
{ document.calc.result.value = x + y;
}
</SCRIPT>
</HEAD>
<BODY>
<Form name="calc">
<input type="text" name="text1">+
<input type="text" name="text2">
<input type="submit" name="submit" value=" = "
onClick="sum(text1.value,text2.value)">
<input type="text" name="result">
</form>
</BODY>
</HTML> Tag: Script to create COM+ application Tag: 142935
Set the root element of xml by xmldom
Hello,
How can I set the root element of xml dom ?
xmldoc = CreateObject("Microsoft.XMLDOM")
... and not how can I set the first (root) element ?
Thanks :) Tag: Script to create COM+ application Tag: 142927
Question about variables - newbie please be gentle
I have not experience with VBScript, I am learning on the fly sorta. I am
working on a project that I think is suited for VBscript. At work we have a
series of files that are uploaded to various geographically located servers.
The uploads are done on a daily basis however the file name changes everyday
to reflect the current days date, e.g. this mornings was "sep13 report.xls".
This needs to be done with around 40 files to three different network
servers. I want to write a script to automate this process, where the user
can input the appropriate dates and the script will find the local file
(based on the inputted date) and transfer it to the remote drive.
So far I have figured out how to define the variables (dim) and how to
prompt for the user input (InputBox) - but when I go to use copyfile to try
and tell the script to look for sep13 report.xls - I am not sure how to get
it to use the variable (sep13) in the filename it is looking for? I hope
this makes sense to you - it is as clear as I can explain it in newbie talk.
Any suggestions regarding this problem specifically or the project in
general would be greatly appreciated.
Have a nice day! Tag: Script to create COM+ application Tag: 142925
Make a status bar to a HTML application (HTA)
Hello,
How can I make a status bar to a HTML application window? I
couldn't find such a property of the HTA:Application object. I
would like to use a
window.status = ...
statement in a VB-script.
JT
--
Posted via http://dbforums.com Tag: Script to create COM+ application Tag: 142920
How to write to hosts file
Hello,
From a jsp page running in IE 6 only browser how can I write an
entry to the client machine hosts file. Client machine could be Win
2K and Win XP.
an example entry in hosts file:
SERVERIPADDRESS SERVERHOSTNAME
Thank you in advance for your help.
LCN
--
Posted via http://dbforums.com Tag: Script to create COM+ application Tag: 142919
mailing an Asp form with exchange
Hope someone can help (I`m on page 1 of teach yourself
VBScript). I am trying to create a form that I can email
from a web server and exchange mail, I have only got so
far in that evrything works in the To, From, CC,
Subjct etc lines. What I have come completely stuck on is
putting the form data into the textbody of the email.
I can select one field from the form in iMsg.textbody but I
do not have a clue how to include multiple fields.
Any pointers appreciated, Cdonts doesnt seem to work as
I am getting a permission error, the mail script below works
fine with exchange.
TIA John
<%@ Language=VBScript %>
<%
submit = Request.Form.Item("B1")
if submit = "Send" then
Dim iMsg
Set iMsg = CreateObject("CDO.Message")
Dim iConf
Set iConf = CreateObject("CDO.Configuration")
Dim Flds
Set Flds = iConf.Fields
' 3 means that you are asking mail to be sent using Exchange Server.
Flds( "http://schemas.microsoft.com/cdo/configuration/sendusing") = 3
Flds("http://schemas.microsoft.com/cdo/configuration/user") = " "
Flds("http://schemas.microsoft.com/cdo/configuration/password") = " "
Flds.Update
Set iMsg.Configuration = iConf
iMsg.To = someone@host.co.uk
iMsg.From = post@host.co.uk
iMsg.CC = me@host.co.uk
iMsg.Subject = "Open Day 21st October 2003 sent": & now()
iMsg.TextBody = Request.Form.Item ("select")
iMsg.Send
end if
%>
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</head>
<body bgcolor=green >
<% if submit = "Send" then
%><font color=white><b><u> Mail Sent</u></b></font> <%
else%>
<form action="SendMail.asp" method="post" name="Form" id="Form">
<P>
<base target="_top">
<TABLE cellPadding=4 cellSpacing=0 class=Nav2>
<tr>
<TR>
<TD vAlign=top><p>
<LABEL><font color="red">Select</font> </LABEL>
</p>
<p>
<LABEL><font color="#FF0000">Select2</font></LABEL>
</p></TD>
<TD> <p>
<select name="select">
<option selected>Please Select
<option>Test CDONTS
<option>Test CDO Ex
</select>
</p>
<P>
<select name="select2">
<option selected>Please Select
<option>One
<option>Two
<option>Three
</select>
<BR>
</P></TD>
</TR>
</TABLE>
<P> <INPUT name=B1 type=submit value="Send"></P>
</form><%end if %>
</body>
</html> Tag: Script to create COM+ application Tag: 142918
Monitoring Exchange 2000 performace
Hi !
I need to monitor Microsoft Exchange 2000
1. Mail Queue length
2. Disk I/O Performance
3. CPU utilization and Memory utilization through vbscript
How can i write query to WMI ?
regards,
Ram Tag: Script to create COM+ application Tag: 142915
Documentation on the "DropDown" object
Hi,
I'm using the "DropDown" object based on it's usage in "Excel 2002 VBA
Programmers Reference" page 208. The text states that this is a hidden
member of the Excel object model. So can anyone point me to some *secret*
documentation on it? I need to know how to remove items from the DropDown
box. The text shows how to add, and just a couple of other
properties/methods. I'd like to know more...
Thank you,
Robert Stober Tag: Script to create COM+ application Tag: 142910
EnableDNS
I am having trouble getting the EnableDNS method from
Win32_NetworkAdapterConfiguration to work. This is what I
am trying just to understand it. I get an invalid method
at line 14 (EnableDns). This is a small part of a much
bigger script. I need this to run on NT4 and Win2000.
Thanks
Dan
set objWMIServices = GetObject("winmgmts:\\.\root\cimv2")
set adapter = GetObject
("winmgmts:win32_NetworkAdapterConfiguration=11")
dim DnsSvrs(2)
dim DnsSfx(1)
DnsHost="MyLaptop"
DnsDom="MyPC.tst"
DnsSvrs(0)="127.0.0.1"
DnsSvrs(1)="127.0.0.2"
DnsSvrs(2)="127.0.0.3"
DnsSfx(0)="Mydomain.com"
DnsSfx(1)="Mydomain2.com"
x=adapter.enableDNS(DnsHost,DnsDom,DnsSvrs,DnsSfx)
wscript.echo x Tag: Script to create COM+ application Tag: 142901
Enumerating a multi-dimensional array
Hi,
I've built a multi-dimensional array from a table and would like to
enumerate the whole thing, but I'm confused. Can anyone help me out?
Thank you,
Robert Stober Tag: Script to create COM+ application Tag: 142900
change the value of a textarea from a script
30 years experience in the mainframe environment but do not know to
much about HTML and VBScript.
Using the following as an example, is it possible to change the value
of the textarea field named "ans" by a script.
Thanks,
Dan
<form name theform>
<table cellpadding="10" border="0" width="50%">
<tr>
<td align="center">Month: <select id="month" name="month"
size="1">
<option value="1">January<option value="2">Febuary<option
value="3">March
<option value="4">April<option value="5">May<option
value="6">June
<option value="7">July<option value="8">August<option
value="9">September
<option value="10">October<option
value="11">November<option value="12">December
</select>
<td align="center">Day: <select id="day" name="day">
<option selected>1<option>2<option>3<option>4<option>5<option>6<option>7<option>8
<option>9<option>10<option>11<option>12<option>13<option>14<option>15<option>16
<option>17<option>18<option>19<option>20<option>21<option>22<option>23<option>24
<option>25<option>26<option>27<option>28<option>29<option>30<option>31
</select>
<td>Year: <select id="year" name="year">
<option selected>2003<option>2004<option>2005<option>2006<option>2007<option>2008
</select>
</table>
<p>
<input type="button" value=" Do It " onClick=builddate>
  ...and the date is:  
<INPUT type="text" name="ans" size=10 readonly>
</form> Tag: Script to create COM+ application Tag: 142898
vbs to return SQL stored procedure info.
I wanted to "bump" this so sorry for the repost.
I still don't know what I'm doing... which means I have
no idea what I'm doing wrong here.
I have a stored proceudre that tells me that status of my
databases. I can run it via query analizer and it runs
great, however I have no idea how to identify this data
when returning it so I can't reference it... If this
makes any sense, please let me know.
Thanks a mill,
-Jess
StrComputer = "R3328"
Set fso = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshNetwork = WScript.CreateObject("WScript.Network")
sqlServer = strComputer & "RCS0001\PRDRCS"
sqlProvider = "SQLOLEDB"
sqlUserName = ""
sqlPassword = ""
AppName = "JesseHarris"
sSQL = "Provider=" & sqlProvider & ";Data Source=" &
sqlServer & ";User Id=" & sqlUserName & ";Password=" &
sqlPassword & ";" & "Application Name=" & AppName & ";"
set cn = CreateObject("ADODB.Connection")
cn.Open sSQL
Set rs = CreateObject("ADODB.Recordset")
sSQL = "exec sp_db_status"
rs.Open sSQL,cn,1,1
wscript.echo rs.eof
rs.Close
set rs = nothing
cn.Close
set cn = nothing
quit Tag: Script to create COM+ application Tag: 142897
Adding machine to domain script
Hello,
Our users currently loging in to WINT4 domain, and we run various scripts to
them with .bat file, is there a way to create a script so that when user
logs on it will add machine automatically to new active directory domain and
copy profile to new profile?
Thank you,
Eimis Tag: Script to create COM+ application Tag: 142896
Date Function Return Values
If i use the date function within a vbscript the value returned is the
system date, but the function does not return the date the way that
the date cmd returns it.
Date function in VBscript: 9/10/2003
date command in command shell: 09/10/2003
I am going to use the value returned from the Date function to
generate a filename in the form of yyyymmdd. Is there any way that I
can force the Date function to return a two digit value for month and
day, i.e. put the 0 (zero) in there?
Thanks for any suggestion,
Darren
Currently I am just using an If to manipulate the string, but i was
hoping for a option within the function to return the 2 digit values Tag: Script to create COM+ application Tag: 142892
Enumerate OS versions
Howdy-
Is there a way using WSH to display (or write to log) the Operating
System Versions of the Workstations in a domain? Not all of the PCs
have WMI, (a good amount of NT WKS) so I think I'm stuck with
WshShell.RegRead or something...
I think I'm close, but I get stuck trying to read a text file for input
(list of the PC names).
Basically, I just want to list PC Name and OS, somehow.
Thanks,
Brian Tag: Script to create COM+ application Tag: 142887
Script to send out MSBlaster and other vulnerabilities
For the VBScript on Microsoft's website
http://support.microsoft.com/default.aspx?kbid=827227
I have found the the script doesn't delete the Patchinst.exe file it
creates on the target machine. If I try to install a different patch
on a machine that this script was run on, it doesn't work. How would I
connect to the machine and check to see if "Patchinst.exe" already
exists on the target machine and if so, delete it? Thanks. Tag: Script to create COM+ application Tag: 142884
Checking for a file on user computers?
Is there a way to check all the computers on my network for a specific file?
If this file exist on the users machine it means that they have run a patch
that is required for everyone to have applied, if not I need to make sure
they get patched. I have a bat file for a log in script that looks like
this:
:2000
if exist %systemroot%\kb824146.log Goto END
CLS
Echo.
Echo.
Echo.
Echo Update in progess ///////PLEASE WAIT!///////
Echo Update in progess ///////PLEASE WAIT!///////
Echo 2000 Detected
net use x: \\mntwsslcalt01\exe /y >nul
call x:\security_patches\kb824146\2000.exe -u -q -z
echo 2000 > \\Mntwsslcalt01\EXE\Security_Patches\kb824146\%computername%
NET SEND %computername% "Your System is updated. *******YOU MUST RESTART
YOUR COMPUTER!*******"
net use x: /d
goto END
but I am hoping to find a solution that I can run from one location that
checks everyone that is currently logged into our network. Is this
possible? Our network consists of all Windows 2000 servers and desktops. Tag: Script to create COM+ application Tag: 142882
Creating a text file name from a variable?
I want to take the list of hotfixes off a machine and create a txt
file with the name of the hotfix + txt.
Option Explicit
Dim Wmi
Dim Hotfix
Dim Hotfixes
Dim fso
Set Wmi = GetObject("winmgmts:\\.\root\cimv2")
Set HotFixes = Wmi.InstancesOf("Win32_QuickFixEngineering")
Sub CreateFiles
For Each HotFix in HotFixes
fso.CreateTextFile(HotFix.HotFixID & ".txt")
Next
End Sub
I don't think this is close but it has been a long week for this
newbie. Tag: Script to create COM+ application Tag: 142881
logging web bug.
I am going to log some visitors at a diffrent location from where the actual
web server is setup. I am thinking of creating a web bug that logs web
visitors
ip date and time. The actual web page i think i have to call the external
web server (where the logging will actually be)...
How can i get the visitors ip through the web scripting?
Do i have to use javascript or vbscript first?
Thanks for listening...
Br,
Christian O.
chot@home.se Tag: Script to create COM+ application Tag: 142875
Internet Explorer 6.0 refresh with VBS
Hello!
Does anyone know how to refresh Internet Explorer 6.0 (Win XP)
via VBScript?
Thanks a lot
Georg Tag: Script to create COM+ application Tag: 142874
How can I delete an entire list of printers?
This is the second-time that I posted this. The first time, I neglected to
include the code. - Sorry!
I can and have written some simple scripts (wmi) that will delete an
individual or specific printer, but for some reason (though it seems easy in
theory) I am having great difficulty in feeding a list of printers to a sub
that will systematically delete each printer in the list.
I have one that I thought would work (but then again, if it did I wouldn't
be posting here).
The code is posted below.
Any help would be greatly appreciated.
TIA
*******************************************************
'---------------------------------------------------------------------------
----
' NAME: DELETE_PRINTERS.vbs
' AUTHOR: Eddie Phillips, Computer Sciences Corporation
' CREATED: 9/3/2003
' MODIFIED: 9/04/2003
'
'*DESCRIPTION: This script will allow you to delete a list of printers.
'---------------------------------------------------------------------------
----
Const ForReading = 1
Set Wshnetwork=CreateObject("Wscript.Network")
'---------------------------------------------------------------------------
----
Set up variables and ask for domain input from user
'---------------------------------------------------------------------------
----
strDomainMsg = "Please enter the Domain Name." & VbCrLF & VbCrLf &_
"Press OK for default Domain"
strDomainTitle = "Enter Domain Name"
strDomainDef = Wshnetwork.UserDomain
'Ask for input
strDomain = Ucase(InputBox (strDomainMsg,strDomainTitle,strDomainDef))
'check for input
If strDomain = "" Then
Terminate 1
End If
'---------------------------------------------------------------------------
----
Set up variables and ask for print server input from user
'---------------------------------------------------------------------------
----
strComputerMsg = "Please enter the Computer Name that you want to check" &
VbCrLF & VbCrLf &_
"Leave Blank for current machine"
strComputerTitle = "Enter Computer Name"
strComputerDef = Wshnetwork.ComputerName
'Ask for input
strComputer = Ucase(InputBox
(strComputerMsg,strComputerTitle,strComputerDef))
'check for input
If strComputer = "" Then
Terminate 2
End If
'---------------------------------------------------------------------------
----
Set up variables and ask for printer list location
'---------------------------------------------------------------------------
----
strListMsg = "Where is your list of Servers?" & VbCrLf & VbCrLf &_
"To exit this script, press CANCEL" & VbCrLf & VbCrLf & VbCrLf &_
"To accept the default, press OK"
strListTitle = "Enter the location of your list"
strListDef = "C:\temp\deleteprinters.txt"
'Ask for input
strList = InputBox(strListMsg,strListTitle,strListDef)
'check for input
If strComputer = "" Then
Terminate 3
End If
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.OpenTextFile(strList,ForReading)
Do While f1.AtEndOfStream<>True
strPrinter = uCase(f1.ReadLine)
If strPrinter<>"" Then
DeletePrinters strDomain,strComputer,strPrinter
End If
Loop
'===========================================================================
==================
' Subs and Functions
'===========================================================================
==================
Sub Terminate(strValue)
Select Case strValue
Case "1"
WScript.Echo "No Domain entered. The script will now Terminate"
WScript.Quit(1)
Case "2"
WScript.Echo "No Computer entered. The script will now Terminate"
WScript.Quit(1)
Case "3"
WScript.Echo "No Printer List entered. The script will now Terminate"
WScript.Quit(1)
Case Else
WScript.Echo "Unspecified Error. The script will now Terminate"
WScript.Quit(1)
End Select
End Sub
Sub DeletePrinters(strDomain,strComputer,strPrinter)
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
WScript.Echo strPrinter
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer where DeviceID = "& strPrinter)
'Attempting to connect to the printer that has been passed!
For Each objPrinter in colInstalledPrinters
If strPrinter = objPrinter.Name Then
objPrinter.Delete_ 'Here is where I want to delete the printer...if
it exists.
WScript.Echo Err.Number
'Display printer..if found (for now) with the "===========" along
with the error code if any.
WScript.Echo vtab & strPrinter & "==========" & objPrinter.Name &
vbtab & "(" &Err.Number & vbTab & Err.Description & ")" 'Display errors
Err.Clear
Else
'Display printer..if NOT found (for now) with the "*********" along with
the error code if any.
WScript.Echo vtab & strPrinter & "**********" & objPrinter.Name & vbtab
&"(" & Err.Number & vbTab & Err.Description & ")"
Err.Clear
End If
Next
End Sub Tag: Script to create COM+ application Tag: 142873
Log off from a Windows 2000
How can I use the windows scripting to execute a log off a windows station.
Thanks.
Wagner Tag: Script to create COM+ application Tag: 142872
how to actively send or push html to client browser
Does anyone know if a way to deliver web pages to an end-client using a push
method that can be controlled from your PC (by clicking on a page menu for
example - the pages can reside on a server). I have looked at CDF but I'm
not trying to create a webcast channel. I just want to deliver an html style
presentation with real time control from my end to a few users only at a
time. The type of system used by PowerPoint with the live broadcast feature
is what I am looking for but I want to have extra stuff on the pages than
just the slides and I also want to be able to move through the sequence
without relying on Powerpoint as my interface.
Thanks for any help.
TJ Tag: Script to create COM+ application Tag: 142868
how to set document properties through vbs script ?
I need to set document properties (author, keywords etc) using a script (in
DOC, XLS, PPT files).
How to do it?
Thanks,
Tomek Tag: Script to create COM+ application Tag: 142865
Folder size
Hi,
Which object returns the folder size i tried
Wscript.Echo "Size: " & objFolder.Size
and got an error.
I'm trying to get %userprofile% size to display a message to the user to
clean up his profile after getting over a limit.
Any help appreciated,
Salah. Tag: Script to create COM+ application Tag: 142863
rename a remote computer
hi,
can somebody help me on how to write a script to rename a remote computer?
thanks Tag: Script to create COM+ application Tag: 142861
MS03-039 (KB824146) VBScript InternetExplorer Error
I recently (11/9) updated Windows2000 with the KB824146 throught the
Automatic Update.
After the update the following code in VBScript does Not Work
Dim xIE 'Reference to Internet Explorer object
Set xIE = GetObject(,"InternetExplorer.Application")
The Error has the following Characteristics
Error Number is 429
Error Description is ActiveX Component Can't Create the object
The truth is that it doesn't work in Windows2000 Greek Edition Fully Updated
but it does work in Windows2000 English Fully Updated.
The Error Description is the equivelant of the greek message I'm getting
The exact Same Code worked in the Windows2000 just before applying the
MS03-039 update. Tag: Script to create COM+ application Tag: 142857
How to import XML into SQL 2000 server using ASP?
Hi
I have a xml contain the information of a file.
Foe example:
<files>
<file>
<filename>First File</filename>
<filedesc>Description of first file</filedesc>
<author>yvonne</author>
</file>
</files>
My question is "How do i use ASP to import this xml file
into SQL2000 server?"
Cheers,
yvonne Tag: Script to create COM+ application Tag: 142855
script code
Hi All,
In the following code, it print 0, 1, ... 9. Why not just print 9?
<HTML>
<HEAD>
<script language="javascript" type="text/javascript">
<!--
i=0
str=""
while (i < 10) {
str += i + "<br>"
i++
}
document.write(str)
// -->
</script>
</HEAD>
<BODY>
</BODY>
</HTML>
Thank you.
Chris Tag: Script to create COM+ application Tag: 142853
I'm trying to create an automation script for creating a
COM+ application. I not seen any examples on this anywhere
just looking for a sample. Thanks