RUNAS+.exe
Does anyone know where I can get this. This is a scriptable runas that
microsoft provides for free.
Thanks Tag: scripting uninstalling device drivers Tag: 177940
IE automation - how to tell when document is complete?
Hi,
I playing with IE automation. Many scripts in this newsgroup show code like
the following to open a web page and wait for its completion:
Set oIEApp = CreateObject("InternetExplorer.Application")
With oIEApp
.Visible = True
.Resizable = True
.FullScreen = False
.Height = 600 : .Width = 600
.Top = 50 : .Left = 100
.Navigate("msdn.microsoft.com")
Do Until .ReadyState = 4 : WScript.Sleep 100 : Loop
MsgBox "Done navigating to msdn.microsoft.com"
End With
Other scripts listen for the DocumentComplete event. If I count the
occurences of the DocumentComplete event, I find that my 'done' message box
appears after the DocumentComplete event has fired twice, and that the
DocumentComplete event fires once more, perhaps right when
msdn.microsoft.com is truely done loading. When just starting IE and
navigating to one URL, waiting for a ReadyState of 4 is sufficient.
Many of us are not satisfied with navigating to only one URL; we want to go
more places. But the ReadyState remains 4 for a hundred or more millisecons
after specifying a new URL, then changes to 3, and finally changes back to 4
when the page has loaded. So we need logic like this for the second URL:
Option Explicit
Dim oIEApp
Set oIEApp = CreateObject("InternetExplorer.Application")
With oIEApp
.Visible = True
.Resizable = True
.FullScreen = False
.Height = 600 : .Width = 600
.Top = 50 : .Left = 100
.Navigate("msdn.microsoft.com")
Do Until .ReadyState = 4 : WScript.Sleep 100 : Loop
MsgBox "Done navigating to msdn.microsoft.com"
.Navigate("aol.com")
Do While.ReadyState = 4 : WScript.Sleep 2 : Loop
Do Until .ReadyState = 4 : WScript.Sleep 100 : Loop
MsgBox "Done navigating to aol.com"
End With
With this script, most of the time the AOL done message occurs when the page
really is loaded. Occasionally, the AOL done message occurs long before the
page really is loaded, especially when CPU usage is high.
From this I have concluded that neither ReadyState nor the DocumentComplete
event are reliable indicators of a web page's being complete.
I've monitored how often various events occur by the time the MsgBoxes
appear, and I'm currently using the following logic to determine completion.
Thanks,
-Paul Randall Tag: scripting uninstalling device drivers Tag: 177939
How do I include/reference functions in another file?
Simple question, as I build up my little library of some useful functions I
want to keep all of these in a "myfuncs.vbs" script. Then when I write a
quick new script I just want to be able to call funtions located in
"myfuncs.vbs". How do I do this?
Thanks for your help in advance!
Regards,
Craig. Tag: scripting uninstalling device drivers Tag: 177933
Listing user name and other values
http://www.rlmueller.net/Programs/CreateUserList2.txt
I'm new to AD and have done some work with VB Script. I've been trying to
modify the above to give me back a list of all the users as well as some of
the values, say phone #, that is listed in AD. So far I've had very little
success on this. Someone willing to point me in the right direction?
--
Thanks
Wayne Sepega
Jacksonville, Fl
Enterprise Library Configuration Console Module Generator
http://workspaces.gotdotnet.com/elccmg
"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein Tag: scripting uninstalling device drivers Tag: 177931
Script Remote Access
I am trying to find information on clients cpu and the script will only run
on a few clients and not all. why is this? Tag: scripting uninstalling device drivers Tag: 177930
RUNAS+.exe
Does anyone know where I can get this? It supposed to be free from Microsoft
yet I can't find it anywhere. It a scriptable runas utility.
Thanks Tag: scripting uninstalling device drivers Tag: 177928
Determining Win95 machines via login script
I am needing to deploy some software to workstations that are Windows 95
(this is not a typo).
What I have done so far is define a BAT file in AD for the User Login Script
that uses the START \\myvbScript.vbs.
The vbScript then tries to make a WINMGTS: connection and when it fails
(Err.Number = 432, Class does not exist) it calls my 9xInstall.BAT file. For
the most part this works since we do not have the WMI Core Environment out
there but I'd rather be checking for the OS specifically, since that is what
I really need to know. Unfortunately, I cannot find a way to do this without
using WMI.
Is there an object I can use to get the OS in vbScript or even a command in
the BAT file that I can rely on?
As always, thanks.
Bart Perrier Tag: scripting uninstalling device drivers Tag: 177927
Adding a Security group to Workstations
I need to add a new security group to several workstations at two different
facilities. The group to be added is different for both locations. I thought
I would be easy to just query AD for the machines in eat locations OU and
then just use a script that would then loop through that list and add the
group. Sadly my scripting skills are still in their infancy and I'm having
troubles finding the info I need to query AD in a manner I can understand.
What I need to know is how to pull something out of a subfolder in an OU that
may be 3 levels deep. I have found several scripts but Iâ??m not sure exactly
what Iâ??m looking at. Does anyone know of an idiotâ??s guide so to speak for
pulling things from AD? Tag: scripting uninstalling device drivers Tag: 177923
Enable "Show Quick Launch"
Is there any one that have a vbscript to enable ""Show Quick Launch" on
Windows Xp clients.
/Andreas Tag: scripting uninstalling device drivers Tag: 177919
VBS, WSH scripting authoring tools
Hello:
We are currently looking for some of the top tools to do VBS and/or WSH
scripting. Basically we are looking for authoring tools that have
pre-defined functions, that are gui-based, for easy ability to create
logon scripts, etc. So far we only know of Microsoft's own free tools
(Scriptomatic, Tweakomatic), and we are looking for something a little
better (commercial products are fine).
Can anybody suggest some of the top tools that are out there now?
Thanks a lot for all feedback...
--
Chris Tag: scripting uninstalling device drivers Tag: 177915
Converting CR to CR/LF
Hi there
I'm a very small newbee, and looking for an easy way to convert a text-file.
Sinece the textfile came through ftp it has only lf at the end of the line,
but I need an cr/lf.
Thanks in advance for any help.
Best regards
Ralf Tag: scripting uninstalling device drivers Tag: 177904
USER NAME ACCESS
Hi All
I am using connection manager administration kit to create a Windows VPN
connection for all home users.
I've written a batch file to map the users home drive once connected to the
VPN
net use H: \\Server\%username%
The problem with the above, the Variable %USERNAME% takes the name from the
user who is logged onto the local computer not the user who is connecting to
the VPN. Does anyone know how I can get the name of the user how is logged
onto the VPN connection into the %username% rather than the user who is
logged onto the local computer.
wayne
PS I am not a scripter I am just learning starting with basic batch files Tag: scripting uninstalling device drivers Tag: 177903
Microsoft.XMLHTTP
I want to download file using "Microsoft.XMLHTTP" object.
My URL is http://qqqqq.com/oo.php?52152
How to determine a real name of downloaded file?
With CreateObject("Microsoft.XMLHTTP")
.Open "Get", "http://qqqqq.com/oo.php?52152", False
.Send
Response = .ResponseBody
With CreateObject("ADODB.Stream")
.Type = 1
.Open
.Write Response
.SaveToFile RealFileName, 2 < - ????
End With
Uka. Tag: scripting uninstalling device drivers Tag: 177899
Date confusion
Hi,
I am developing a webpage in conjunction with MS access. I use dates as a
primary attribute to search for data. However, on somedays the program will
work with the date format mm/dd/yyyy and other times it is dd/mm/yyyy and
sometimes it will work with both. When it works with both this causes the
most confusion. In some parts of the program the application will work with
the mm/dd/yyyy format and some other parts with dd/mm/yyyy. However other
parts of the program will crash because it is of the wrong format.
My question is... Is there some way of making it conssitent throughout the
application? My regional settings is set to Australia.
Thanks in Advance Tag: scripting uninstalling device drivers Tag: 177897
Scriptomatic 2 fails @ line 452
I'm running Windows XP/SP2 and when I run Scriptomatic 2.0 and select an
WMI_Class, I get a script error on line 452 where it's trying to create an
"WScript.Network" object. This works fine if I issue the same commands from
an VBS file.
Do I need to do something special to make HTA's work on my PC? I disabled
my antivirus software just in case (wasn't getting an error there), tried
changing my security level for local intranets to LOW, nothing seems to work.
The program works just fine under Win2k. Tag: scripting uninstalling device drivers Tag: 177888
Adding method to response object
Is it possible to add or override any of the methods in the Response
object? I'd like to change how Response.Write works a little bit...
--
J.B.Moreno Tag: scripting uninstalling device drivers Tag: 177887
Domain information through vbs
Good afternoon,
Here is what I would like to achieve but do not know how!
I would like to create a script that
1- run dos command "net group GROUPNAME /domain" and write it to a textfile
2- Using the textfile of users, run the dos command "net user USERNAME
/domain" (using 1 by 1 the user from the textfile in 1) and write it to
another textfile
3- Go through the textfile created in 2 and validate certain parameter such
as "logon script".
Can someone run me through this or point me to a web site that can provide
me with the basics on how I can do this type of script.
One of my main problem is how I can use the text file created in 1 in 2
since it is output in a tabular format (3 columns) and vbs will read it 1
line at a time. How can I transform the dos output into a valid format to
use in 2?
Thank you for any help!
Daniel Tag: scripting uninstalling device drivers Tag: 177886
Accessing Outlook Subfolders
I'm trying to add/remove a user form a folders' ACL.
This code works fine on a single folder:
Set oInbox = oSession.GetDefaultFolder(CdoDefaultFolderInbox)
Set oACLObject = CreateObject("MSExchange.ACLObject")
oACLObject.CDOItem = oInbox
Set oACEs = oACLObject.ACEs
How do I change this to do the same for folders under the Outlook Inbox?
Thanks! Tag: scripting uninstalling device drivers Tag: 177883
Capture screen output of Telnet using vbscript
Is there any way to capture the screen output of a telnet session to a text
file? Code to do it would be very much appreciated as I'm on a short time
limit. However, an explaination of how to do it will also suffice.
I currently use a 3rd party program to do this however I am trying to
accomplish this task with only what Windows 2000 Professional comes with
(including WSH 5.6). I have tried to do this with batch files but was
unable to do so. I wrote vbscript to send commands to telnet but can't find
a way to capture the screen output to a text file.
Thanks in advance,
Chris Tag: scripting uninstalling device drivers Tag: 177880
Copy folder with permisions intact
I need to migrate users home folders to a new server. About 60 GB in all. So
they need to be copied or moved with permisions and hopefully any share
permisions intact.
Can this be done with objFolder.CopyHere? or objFolder.Copy? Or would it be
easier/better to use xcopy or something?
Thanks Tag: scripting uninstalling device drivers Tag: 177870
List OU's in an OU using VBS
Hi
I am new to VBscript and would like to be able to query an OU for it's
contents (which is more OU's) and then display the results in the text
field on an inputbox. This is so that the user can enter the name of
one of the OU's listed into the inputbox input field.
Hope this makes sense.
Thanks in advance
Keith Tag: scripting uninstalling device drivers Tag: 177867
Writing xml.ResponseText to file
Hello, I'm having some problems writing out xml.ResponseText to a text
file. I can send it to a web browser using Response.Write, but I can
not write it out to a text file. It's not a permissions issue, the
file gets created without a problem and if you write a line of plain
text to the file, it works perfectly. I tried casting xml.ResponseText
to a string, but that did not work either. Is there anyway I can do
this?
<%
Const ForWriting = 2
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", "http://xxxx", False
xml.Send
set tfile=FSO.CreateTextFile("c:/pathtofile.asp", true)
'response.write xml.ResponseText <--- Works
'tfile.WriteLine "Hello World" <---- Works
tfile.WriteLine(test)
tfile.close
set fso = nothing
%> Tag: scripting uninstalling device drivers Tag: 177862
Using Replace with wildcard
How can I use replace to replace a dynamic string that is sent over to my
broswer using a wildcard?
Here is a snip of my code,
extract = Replace(extract, "href", "")
for example here is what the browser sees,
href="javascript:show('1','http://server/page.asp=FDR2dmwjDE%3Byt2q%26FDT7w%
7Cq612d4
but I want it to look like
" " instead
after the 'href' is a long string that is dynamically changed each time the
page is viewed, how can I use Replace to remove anything following the
'href' but nothing below that line of code?
Thanks in advance.. Tag: scripting uninstalling device drivers Tag: 177859
Newbie: Small Script to Delete files
Hi Group,
Hope your all well?
I wonder if somebody could give me some help on this one, or maybe some
Examples?
I have a Directory call C:\HFSWIN\ In here I have around 90 files, with
vereous file formats. I would like to be able to delete all files files that
end with *.lbl, *.lbv, & *.lbb. Except these 9 files:
Jordans1.lbl
Jordans2.lbl
Jordans3.lbl
Jordans1.lbv
Jordans2.lbv
Jordans3.lbv
Jordans1.lbb
Jordans2.lbb
Jordans3.lbb
Is this possible?
Many Kind Thanks
Regards
Simon Tag: scripting uninstalling device drivers Tag: 177853
Right click on text vs. right click on hyperlink
Is there a way that Windows script can tell whether the mouse has right
clicked on the text area of a web page, or whether it has right clicked
on a hyperlink on the webpage? I have a Windows script in an htm file
that I want to behavior differently depending on whether the first
condition or the second condition exists .
Thanks,
Larry Tag: scripting uninstalling device drivers Tag: 177843
Trying to process a large AD group
I'm trying to cycle through all the members of a large AD group, but it
seems to hit some type of maximum at 1500. Below is the snippet of code:
arrMemberOf = objGroup.GetEx("member")
' Loop = For Each .... Next
WScript.Echo "Members of Group " & strContainer
For Each strMember in arrMemberOf
' WScript.echo strmember
Set objItem = GetObject("LDAP://" & strmember)
strsAMAccountName = objItem.Get("sAMAccountName")
' WScript.Echo "sAMAccountName: " & strsAMAccountName
<snip>
Any ideas? Is 1500 the maximu number of elements in the array arrMemberOf?
Thanks.
(rookie VBS coder, go easy)
-GT Tag: scripting uninstalling device drivers Tag: 177839
Inserting images in RTF?
How can I programatically insert images into my rtf-file?
I generate the files with asp in combination with the rtf-spec but I can't
figure out how I can insert images from file.
Any suggestions? Tag: scripting uninstalling device drivers Tag: 177838
Using WSH to Copmpare Files
Hello all,
Is there a way I can use WSH to compare two files for equality? Do I
have to call the DOS 'fc' or 'comp' commands?
I was thinking about writing my own comparison function by then I'd
have to be able to read a binary file. Is this possible as well?
Thank you.
--
Tony LaPaso Tag: scripting uninstalling device drivers Tag: 177837
Need freeware IDE
I just started working with scripting (VBScript, WMI, WSH).
I know how beneficial these tools will be, but I have not been able to
convince anyone to cough up the cash for an IDE tool.
What are some good free tools (Not Notepad) that I can use as an IDE?
Thanks
ccoates Tag: scripting uninstalling device drivers Tag: 177829
Smart Tags to call vbscript?
Anyone know if its possible to use smart tags to call a
vbscript...without having to write a custom dll or use the sdk? Just
wondering if its possible via a simple xml file. Tag: scripting uninstalling device drivers Tag: 177828
VBScript Samples
What is the URL to get to all of the samples for vbscript tasks? I saw it
mentioned the other day but didn't save it. Tag: scripting uninstalling device drivers Tag: 177824
Need Help Adding First Name and Last Name to "Display Name:" field
I'm new to scripting and am trying to automate new users set ups. I'm
using this great script and testing with a user name of John A Smith.
The "First Name:" and "Last Name:" fields populate as expected. The
"Display Name:" field populates as JASmith. I need the name to popluate
this field like this John A Smith. Is this possible? This is the
script I'm using from Mr. Muellers site. Thanks
' CreateUsers.vbs
' VBScript program to create users according to the information in a
' Microsoft Excel spreadsheet.
'
'
----------------------------------------------------------------------
' Copyright (c) 2003 Richard L. Mueller
' Hilltop Lab web site - http://www.rlmueller.net
' Version 1.0 - September 8, 2003
' Version 1.1 - January 25, 2004 - Modify error trapping.
' Version 1.2 - March 18, 2004 - Modify NameTranslate constants.
'
' You have a royalty-free right to use, modify, reproduce, and
' distribute this script file in any way you find useful, provided that
' you agree that the copyright owner above has no warranty,
obligations,
' or liability for such use.
Option Explicit
Dim objExcel, strExcelPath, objSheet
Dim strLast, strFirst, strMiddle, strPW, intRow, intCol
Dim strGroupDN, objUser, objGroup, objContainer
Dim strCN, strNTName, strContainerDN
Dim strHomeFolder, strHomeDrive, objFSO, objShell
Dim intRunError, strNetBIOSDomain, strDNSDomain
Dim objRootDSE, objTrans, strLogonScript, strUPN
' Constants for the NameTranslate object.
Const ADS_NAME_INITTYPE_GC = 3
Const ADS_NAME_TYPE_NT4 = 3
Const ADS_NAME_TYPE_1779 = 1
' Specify spreadsheet.
strExcelPath = "c:\NewUserFolder\NewUsers.xls"
' Specify DN of container where users created.
'strContainerDN = "ou=user,ou=ho,ou=ccmc service
centers,Sales,dc=ccmc,dc=com"
strContainerDN = "ou=test gpos,ou=xyc service centers,dc=ccmc,dc=com"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.Shell")
' Determine DNS domain name from RootDSE object.
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
' Use the NameTranslate object to find the NetBIOS domain name
' from the DNS domain name.
Set objTrans = CreateObject("NameTranslate")
objTrans.Init ADS_NAME_INITTYPE_GC, ""
objTrans.Set ADS_NAME_TYPE_1779, strDNSDomain
strNetBIOSDomain = objTrans.Get(ADS_NAME_TYPE_NT4)
' Remove trailing backslash.
strNetBIOSdomain = Left(strNetBIOSDomain, Len(strNetBIOSDomain) - 1)
' Open spreadsheet.
Set objExcel = CreateObject("Excel.Application")
On Error Resume Next
objExcel.Workbooks.Open strExcelPath
If Err.Number <> 0 Then
On Error GoTo 0
Wscript.Echo "Unable to open spreadsheet " & strExcelPath
Wscript.Quit
End If
On Error GoTo 0
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
' Bind to container where users to be created.
On Error Resume Next
Set objContainer = GetObject("LDAP://" & strContainerDN)
If Err.Number <> 0 Then
On Error GoTo 0
Wscript.Echo "Unable to bind to container: " & strContainerDN
Wscript.Quit
End If
On Error GoTo 0
' Start with row 2 of spreadsheet.
' Assume first row has column headings.
intRow = 2
' Read each row of spreadsheet until a blank value
' encountered in column 5 (the column for cn).
' For each row, create user and set attribute values.
Do While objSheet.Cells(intRow, 5).Value <> ""
' Read values from spreadsheet for this user.
strFirst = Trim(objSheet.Cells(intRow, 1).Value)
strMiddle = Trim(objSheet.Cells(intRow, 2).Value)
strLast = Trim(objSheet.Cells(intRow, 3).Value)
strPW = Trim(objSheet.Cells(intRow, 4).Value)
strCN = Trim(objSheet.Cells(intRow, 5).Value)
strNTName = Trim(objSheet.Cells(intRow, 6).Value)
strUPN = Trim(objSheet.Cells(intRow, 7).Value)
strHomeFolder = Trim(objSheet.Cells(intRow, 8).Value) & strCN
strHomeDrive = Trim(objSheet.Cells(intRow, 9).Value)
strLogonScript = Trim(objSheet.Cells(intRow, 10).Value)
' Create user object.
On Error Resume Next
Set objUser = objContainer.Create("user", "cn=" & strCN)
If Err.Number <> 0 Then
On Error GoTo 0
Wscript.Echo "Unable to create user with cn: " & strCN
Else
On Error GoTo 0
' Assign mandatory attributes and save user object.
If strNTName = "" Then
strNTName = strCN
End If
objUser.sAMAccountName = strNTName
On Error Resume Next
objUser.SetInfo
'WScript.Echo Err.Number
'WScript.Echo Err.Description
If Err.Number <> 0 Then
If Err.Number = -2147019886 Then
Wscript.Echo strNTName & " User already exists."
Else
Wscript.Echo "Unable to create user with NT name: " &
strNTName
End If
On Error GoTo 0
Else
' Set password for user.
objUser.SetPassword strPW
If Err.Number <> 0 Then
On Error GoTo 0
Wscript.Echo "Unable to set password for user " & strNTName
End If
On Error GoTo 0
' Enable the user account.
objUser.AccountDisabled = False
If strFirst <> "" Then
objUser.givenName = strFirst
End If
' Assign values to remaining attributes.
If strMiddle <> "" Then
objUser.initials = strMiddle
End If
If strLast <> "" Then
objUser.sn = strLast
End If
If strUPN <> "" Then
objUser.userPrincipalName = strUPN
End If
If strHomeDrive <> "" Then
objUser.homeDrive = strHomeDrive
End If
If strHomeFolder <> "" Then
objUser.homeDirectory = strHomeFolder
End If
If strLogonScript <> "" Then
objUser.scriptPath = strLogonScript
End If
' Set password expired. Must be changed on next logon.
objUser.pwdLastSet = 0
' Save changes.
On Error Resume Next
objUser.SetInfo
If Err.Number <> 0 Then
On Error GoTo 0
Wscript.Echo "Unable to set attributes for user with NT name: "
_
& strNTName
End If
On Error GoTo 0
' Create home folder.
If strHomeFolder <> "" Then
If Not objFSO.FolderExists(strHomeFolder) Then
On Error Resume Next
objFSO.CreateFolder strHomeFolder
If Err.Number <> 0 Then
On Error GoTo 0
Wscript.Echo "Unable to create home folder: " &
strHomeFolder
End If
On Error GoTo 0
End If
If objFSO.FolderExists(strHomeFolder) Then
' Assign user permission to home folder.
intRunError = objShell.Run("%COMSPEC% /c Echo Y| cacls " _
& strHomeFolder & " /T /E /C /G " & strNetBIOSDomain _
& "\" & strNTName & ":F", 2, True)
If intRunError <> 0 Then
Wscript.Echo "Error assigning permissions for user " _
& strNTName & " to home folder " & strHomeFolder
End If
End If
End If
' Dim ObjNet
' Set ObjNet = CreateObject("Wscript.Network")
' ObjNet.MapNetworkDrive "u:", strHomeFolder
' Set ObjNet = nothing
Dim oMailBox
Set oMailBox = objUser
oMailbox.CreateMailbox Trim(objSheet.Cells(intRow, 11).Value)
'WScript.Echo FindAnyMDB()
objUser.setInfo
Set oMailBox = Nothing
' Group DN's start in column 11.
intCol = 12
Do While objSheet.Cells(intRow, intCol).Value <> ""
strGroupDN = Trim(objSheet.Cells(intRow, intCol).Value)
On Error Resume Next
Set objGroup = GetObject("LDAP://" & strGroupDN)
If Err.Number <> 0 Then
On Error GoTo 0
Wscript.Echo "Unable to bind to group " & strGroupDN
Else
objGroup.Add objUser.AdsPath
If Err.Number <> 0 Then
On Error GoTo 0
Wscript.Echo "Unable to add user " & strNTName _
& " to group " & strGroupDN
End If
End If
On Error GoTo 0
' Increment to next group DN.
intCol = intCol + 1
Loop
End If
End If
Set objUser = nothing
' Increment to next user.
intRow = intRow + 1
Loop
Wscript.Echo "Done"
' Clean up.
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit
Set objUser = Nothing
Set objGroup = Nothing
Set objContainer = Nothing
Set objSheet = Nothing
Set objExcel = Nothing
Set objFSO = Nothing
Set objShell = Nothing
Set objTrans = Nothing
Set objRootDSE = Nothing Tag: scripting uninstalling device drivers Tag: 177823
script to enable Wakeup on NIC
Hello all,
I'm trying to write a script to enable the power management features for a
NIC, specifically to enable:
allow the computer to turn off this device to save power
allow this device to bring the computer out of standby
Only allow management stations to bring the computer out of standby
I have had a look thru WMI and cannot locate a value I can manipulate. This
needs to be changed on 1000's of computers... Can it be scripted?
Thanks in advance,
John Tag: scripting uninstalling device drivers Tag: 177820
Compare text files for duplicates
Hi. I have two text files that are actually exports of user and computers
accounts from two domains. I would like to be able to compare the two files
for duplicate names and spit out a "report" of the unique names and duplicate
names.
Of course, I can't do a line-by-line comparison because the files don't
match up that way. It is more of a comparison of the entire contents of the
files.
Maybe logparser would do this?
Thanks! Tag: scripting uninstalling device drivers Tag: 177818
Detecting the OS Language
Does anyone have a good way to detect the OS Language Windows is using with
VBScript?
Thanks
Tom Tag: scripting uninstalling device drivers Tag: 177817
WE INVITE YOU
--WebTV-Mail-19411-12917
Content-Type: Text/Plain; Charset=US-ASCII
Content-Transfer-Encoding: 7Bit
Hello My friends hope everyone doing well.
We have a new News Group for people to discuss topics of there concern..
Please take the time to stop by and say hello...Yes it's Docextreme.
This group was formed for all TOPIC'S
WEBTV, PC, related questions if you would like to start a TOPIC by all
means do so.
The WEBTV world is changing so much we now have TNB...as well I have not
yet use one but I hear alot of things about it not all good.
let us know what you know about TNB..
You think if Microsoft came out with a new box it would better then what
we have now after we are the one making them rich...
TOOL'S I think this is a good topic seeing we use web tools each and
everyday. What are some of your favorite tools to use? and offen do you
use them. I have already started a TOOL topic you can follow it with
your coments I would really like to know what are your favorites.
Thank you all so much for the support you have giving me over the past
years I thank you so much....Hope to see some of the nics I am use to
seeing....
P.S. PLEASE read charter before post
Server Extreme News Group
news:alt.discuss.clubs.public.website.promotion.serverextreme
--WebTV-Mail-19411-12917
Content-Description: signature
Content-Disposition: Inline
Content-Type: Text/HTML; Charset=US-ASCII
Content-Transfer-Encoding: 7Bit
<html><body bgcolor="#ffffff"text="000066"><br><br><font
size="3"color="#000066"><u><b>Affordable Hosting</b></u></font>
<p><font size="2"color="#000066"><b>Server Extreme Hosting</b></font>
<a href="http://serverextremehosting.com"><br><font
color="darkgoldenrod">http://serverextremehosting.com</font></a>
<p><font size="2"color="#000066"><b>Server Extreme News Group</b></font>
<a
href="news:alt.discuss.clubs.public.website.promotion.serverextreme"><br><font
color="darkgoldenrod">news:alt.discuss.clubs.public.website.promotion.serverextreme</font></a>
<p>
<font size="2"color="#000066"><b>ServerExtreme Forum</b></font><a
href="http://www.serverextremehosting.com/Support/"><br><font
color="darkgoldenrod">http://serverextremehosting.com/Support/</font></a>
<center><p><br><br><font size="2"color="#000066"><u>Powered By: Server
Extreme Hosting</u></font></center><bgsound
src="http://tabledoc.serverextremehosting.com/ExtremeMod/SEA.mod"loop="5">
</body></html>
--WebTV-Mail-19411-12917-- Tag: scripting uninstalling device drivers Tag: 177816
Running a script using VB6 ScriptControl
First I apoligize for cross posting this also on the vb.controls newsgroup,
I just wasn't quite sure which group would be better suited to handle my
question...
I'm running a script (set up as a string) internal in my VB6 program and
feeding it into the MS ScriptControl. All works well except that I need the
script to
"sleep" for a few seconds. If I wrote the script as a standard .vbs script
file outside of VB I would add a line like this - WScript.Sleep(3000) -
With the WScript object being the intrinsic built in object of the scripting
engine. However, adding that line to my script string in the VB6 program
throws rt error 424 "Object Required: WScript".
So it seems the intrinsic object WScript is not recognized when you run a
script using the VB ScriptControl.
Anybody know how to get around this problem so that the WScript object can
be used, or at least how to make the script "Sleep"
TIA
Ron Tag: scripting uninstalling device drivers Tag: 177815
vb script to run a desktop shortcut
what would be the way in VBS to run a desktop shortcut... I can't just call
the program exe as there are parameters I need that are in the
shortcut....mainly start in
thx. Tag: scripting uninstalling device drivers Tag: 177812
Error Handling
Good morning,
I have the following script (feel free to improve/comments so I can learn).
My problem is that it uses a text file to give it a series of computername to
run the script against. The issue is that when a computer is turned off, the
script returns an error. I would like to trap that error and then move on to
the next computer in the text file. Could someone guide me as to why my
error handler does not work.
'*********************VBS Code starts here*******************
On Error GoTo ErrHandler
ForReading = 1
strNewFile = "PCListing01.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strNewFile, ForReading)
Do Until objFile.AtEndOfStream
strComputer = objFile.ReadLine
'Set objOption = Document.createElement("OPTION")
'objOption.Text = strLine
'objOption.value = strLine
'CmptName.add(objOption)
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery("Select * from
Win32_OperatingSystem")
For Each objOS in colOperatingSystems
dtmBootup = objOS.LastBootUpTime
dtmLastBootupTime = WMIDateStringToDate(dtmBootup)
dtmSystemUptime = DateDiff("h", dtmLastBootUpTime, Now())
strHTML = strHTML & strComputer & " has been up for " &
dtmSystemUptime & " hrs" & vbcrlf
'Wscript.Echo strComputer
'Wscript.Echo dtmBootup
'Wscript.Echo dtmLastBootupTime
'Wscript.Echo dtmSystemUptime
Next
Loop
objFile.Close
Wscript.Echo strHTML
Function WMIDateStringToDate(dtmBootup)
WMIDateStringToDate = CDate(Mid(dtmBootup, 5, 2) & "/" & Mid(dtmBootup,
7, 2) & "/" & Left(dtmBootup, 4) _
& " " & Mid (dtmBootup, 9, 2) & ":" & Mid(dtmBootup, 11, 2) & ":" &
Mid(dtmBootup, 13, 2))
End Function
ErrHandler: ' this is a named range called ErrHandler
' If there was an error raised by the function we would wind up in here 'so
display a message to the user to 'show what went wrong
if err.number=0x80041003 then
strHTML = strHTML & "Unable to reach " & strComputer
Next ObjFile
Resume Next
else
'MsgBox "An error happened here!" & vbCrLf & _
'"Error number: " & Err.Number & vbCrLf & _
'"Error Description" & Err.Description & vbCrLf & _
'"Error Help Context ID" & Err.HelpContext & vbCrLf & _
'"Error Help File" & Err.HelpFile, vbCritical, "ERROR MESSAGE"
'Err.Clear ' destroy the error andâ?¦
' â?¦ this resumes in the last known position.
' in this case, since its not more than a file opening occurring,
' it will simply exit the function for you.
Resume Next
end if
'*********************VBS Code ends here*******************
Thanks,
Daniel Tag: scripting uninstalling device drivers Tag: 177807
Setting Terminal Server settings in AD
HI all:
Does anyone have any code that will allow me to change a users terminal
server settings in AD? I used to use TSCMD.exe on W2K terminal servers but
now its has stopped working and is giving an error 1317 cannot set user
settings. The script that I was using before without problems no longer
works and I am looking for something new! any suggestions would be great! Tag: scripting uninstalling device drivers Tag: 177796
What does this permission indicate...
I run a vbs script on several machines. All has worked except for one
machine. The script essentially performs a backup via WinZip and places the
result in a shared folder.
When I then try to copy the script from the master station, this one
workstation gives me an 'access denied' message. I am running as
administrator on all machines. By the way, I'm running XP Home /SP2 with
Norton AV , and I run SptBot-Search & Destroy. No indicated problems.
I looked at the permissions on the shared folder and I noticed something on
this workstation that I have never seen on the other workstations on our
private lan:
NT AUTHORITY\NETWORK SERVICE:(special access:)
DELETE
SYNCHRONIZE
FILE_READ_DATA
If I remove file sharing on this folder and then re-apply file sharing, this
entry disappears (and my network copy works fine). Furthermore, if I go
into safe-mode and look at the permissions, it says that this item is an
'unknown user'.
What is Win XP trying to tell me? I have never seen this type of permission
before.
Dick Tag: scripting uninstalling device drivers Tag: 177794
How to send log file via email
This is a multi-part message in MIME format.
------=_NextPart_000_00D7_01C58BAC.DA457CF0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
How do I send a log or text file over e-mail as a service. The unit in =
question will not be logged in???
--=20
SHANE CLARK
------=_NextPart_000_00D7_01C58BAC.DA457CF0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1499" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>How do I send a log or text file over =
e-mail as a=20
service. The unit in question will not be logged in???</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><BR>-- <BR>SHANE =
CLARK</FONT></DIV></BODY></HTML>
------=_NextPart_000_00D7_01C58BAC.DA457CF0-- Tag: scripting uninstalling device drivers Tag: 177788
Show jpeg in a VBS dialog (message) box????
Hello,
Is there a way to show a thumbnail of a jpeg file in a VBS dialog (message) box?
TIA,
Bill
bill@2burkes.com Tag: scripting uninstalling device drivers Tag: 177784
getting script to paste text into Word AND to trigger AutoOpen macro
I have an .htm file, which is run from a button I installed on the
Internet Explorer shortcut menu, which contains Windows script that does
the following:
1. copies the selected text on the current web page and assigns the url
of the web page to a variable;
2. opens a special Word document created for this purpose;
3. pastes the selection and inserts the url into the Word document.
However, I also have an AutoOpen macro in the Word document which is
intended to perform further steps on the pasted material. The problem
is that the actions initiated by the script, such as the pasting of the
text, seem to prevent the AutoOpen macro from running.
Here's my question: Is it possible both to have the script open the
Word document and paste stuff into it, AND to have an AutoOpen macro
proceed to do further actions on the pasted text? If not, is there some
other way that the script could automatically run a macro in the Word
document?
Thanks,
Larry Tag: scripting uninstalling device drivers Tag: 177781
Script to add IPP printer connection
I'm trying to use AddWindowsPrinterConnection. I need to connected to an IPP
printer. Which command should I use?
Thank you Tag: scripting uninstalling device drivers Tag: 177780
using a text file as source for strcomputer in vbs script.
I have the following VBS script for ending a process on a remote pc.
as follows
strComputer = "COMPUTERNAME"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'PROCESSNAME'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
However if I want to run this on the whole of an OU how should I go
about this? I can get a list of pcs into a text file, but how do I
have it so that the computer name is sourced from this list?
Thanks
Dan Tag: scripting uninstalling device drivers Tag: 177777
WshController error
Hello all,
I've been doing some research on WshController, and I read recently
that one hang up that WshController has is that it can't be used with
UI. I'm trying to execute a vbscript that uses WshController from a
jsp page. According to an article I read it says: "the script passed
to the WshController object's CreateScript method doesn't interact with
the UI. In other words, you need to avoid using WScript.Echo, STDIO,
WshShell::Popup, MsgBox, InputBox, and other UI functions in the script
that the target remote computer will run." Is this true? Has anyone
been able to interact with WshController from a jsp? Tag: scripting uninstalling device drivers Tag: 177776
How to create a variable of type Long
Hi,
VBScript has a lot of predefined constants with predefined data types. For
example, vbYellow is type long and has the value &h00FFFF (65535). How can
I create constant myYellow of type long, given a hex string of the format
&h00FFFF?
The following obviously doesn't work:
---
const myYellow = &h00FFFF
MsgBox "(vbYellow = &h00FFFF) is " & (vbYellow = &h00FFFF) & vbCrLf & _
"(vbYellow = 65535) is " & (vbYellow = 65535) & vbCrLf & vbCrLf & _
"(myYellow = &h00FFFF) is " & (myYellow = &h00FFFF) & vbCrLf & _
"(myYellow = 65535) is " & (myYellow = 65535)
---
The script gives me:
(vbYellow = &h00FFFF) is False
(vbYellow = 65535) is True
(myYellow = &h00FFFF) is True
(myYellow = 65535) is False
Thanks,
-Paul Randall Tag: scripting uninstalling device drivers Tag: 177775