Give Back to IT Community (Help)
Guys,
I want to start giving back to the IT Community, and start helping
out. I would appreciate if you guys could answer some of the below
questions.
1. How do you guys read your newsgroup subscriptions? Software or
Via Web? List which do you use.
2. Which web portals do you recommend to use to read/respond to posts
& blogs during lunch/break at work? (At work I cant access newsgroups
or blogs via a program or nntp)
3. What program do you guys use for managing your blog subscriptions?
Software or Via Web? List which do you use.
4. How do you keep track of all the messages you've posted or replied
too, this way you can follow-up on it, in case someone responds?
5. Do you guys provide your email address in your posts? If you do,
how do you handle protecting yourself from spam? If you dont, how
does anyone ever get a hold of you, if needed?
6. Out of curiosity, what email provider do you use, and what program
do you use to read your emails?
7. What do I need to do to make sure I get credit for giving back to
the community, this way I can work my way up to an MVP?
8. How else can I become part of the IT community and start giving
back and networking? Any Ideas?
I appreciate you taking your time to respond to my posts, and I plan
to begin giving back to the IT community, and hope we can become
friends.
- Julio (DJ) Tag: I would like to control Powerpoint by VBS Tag: 200319
OU with a space
I'm using a user creation script I found on the net to create user accounts.
The OU in which I want to put the user accounts has a parent OU with a space
in the name (i.e ou=students,ou=myschool,ou=section6,ou=ueser
accounts,dc=mydomain,dc=.com). In my script, do I use a forward slash to
delineate the space? Tag: I would like to control Powerpoint by VBS Tag: 200315
Newbie Question
Please cut me some slack while I try to figure/sort this all out. I've been
dabling in vbscript for a while now but I'm sure most of you know more then
I'll ever forget or however that saying goes (pardon the dramatics).
I'm trying to create a script that will read the folder properties of the
sub directories in the Users, Departmental, Redirected and Profiles shares
on my server (see my initial code below). Essentially, I want to know the
paths to the folders, dates created, last modified and accessed and what
size they are. I know out some point I'll have to create some kind of loop
and I think I'm confortable with figuring that out. But I do have three
questions if anyone has time.
1. Right now I'm thinking the best thing to do will be to redirect a dir
cmd of each folder to a text file and have my script use that file to figure
out the paths to the sub directories. Is there another way I could do this
such as a command that would say, 'for each sub folder of the Users
folder...' (but only going down one level.
2. In my line Call Show(wscript.Name & "," & wscript.ParentFolder & ","&
wscript.Path & "," & wscript.Size & "," & wscript.DateCreated & "," &
wscript.DateLastModified & "," & wscript.DateLastAccessed) I get error
messages saying that not all my wscript.xxx properties are recognized. Can
someone please point me to a web page that lists the possible properties?
3. What is the best source to learn the difference between wscript,
cscript, wsh and all the other acronyms ('sub types of vbs???) that seem to
belong to vbs? A certain book and or website? Should a basic Microsoft or
Sybex book for example cover these topics?
Thanks,
Jeremy
CODE
----------------------------
'Jeremy Schubert
'folderaudit.vbs
'Determines path, parent folder, creation date, last accessed and modified
dates, and size of the Users folders
'on the Bishop Grandin High School Admin Server
L_Welcome_MsgBox_Message_Text = "This script will display the property
attributes for the User Folders on the BGHS Admin Server (S047-A0371-01)."
L_Welcome_MsgBox_Title_Text = "Folder Size"
Call Welcome()
Dim objXL
Set objXL = WScript.CreateObject("Excel.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("i:\users")
objXL.Visible = TRUE
objXL.WorkBooks.Add
objXL.Columns(1).ColumnWidth = 20
objXL.Columns(2).ColumnWidth = 30
objXL.Columns(3).ColumnWidth = 40
objXL.Columns(4).ColumnWidth = 50
objXL.Columns(5).ColumnWidth = 60
objXL.Columns(6).ColumnWidth = 70
objXL.Columns(7).ColumnWidth = 80
objXL.Cells(1, 1).Value = "Folder Name"
objXL.Cells(1, 2).Value = "Parent Folder"
objXL.Cells(1, 3).Value = "Folder Path"
objXL.Cells(1, 4).Value = "Folder Size"
objXL.Cells(1, 5).Value = "Date Created"
objXL.Cells(1, 6).Value = "Date Last Accessed"
objXL.Cells(1, 7).Value = "Date Last Modified"
objXL.Range("A1:G1").Select
objXL.Selection.Font.Bold = True
objXL.Selection.Interior.ColorIndex = 1
objXL.Selection.Interior.Pattern = 1 'xlSolid
objXL.Selection.Font.ColorIndex = 2
objXL.Columns("B:B").Select
objXL.Selection.HorizontalAlignment = &hFFFFEFDD ' xlLeft
Dim intIndex
intIndex = 2
Sub Show(strName, strValue, strDesc)
objXL.Cells(intIndex, 1).Value = strName
objXL.Cells(intIndex, 2).Value = strValue
objXL.Cells(intIndex, 3).Value = strDesc
intIndex = intIndex + 1
objXL.Cells(intIndex, 1).Select
End Sub
'
' Show WScript properties
Call Show(wscript.Name & "," & wscript.ParentFolder & ","& wscript.Path &
"," & wscript.Size & "," & wscript.DateCreated & "," &
wscript.DateLastModified & "," & wscript.DateLastAccessed)
' Show command line arguments.
'
Dim colArgs
Set colArgs = WScript.Arguments
Call Show("Arguments.Count", colArgs.Count, "Number of command line
arguments")
For i = 0 to colArgs.Count - 1
objXL.Cells(intIndex, 1).Value = "Arguments(" & i & ")"
objXL.Cells(intIndex, 2).Value = colArgs(i)
intIndex = intIndex + 1
objXL.Cells(intIndex, 1).Select
Next
' ********************
' *
' * Welcome
' *
Sub Welcome()
Dim intDoIt
intDoIt = MsgBox(L_Welcome_MsgBox_Message_Text, _
vbOKCancel + vbInformation, _
L_Welcome_MsgBox_Title_Text )
If intDoIt = vbCancel Then
WScript.Quit
End If
End Sub Tag: I would like to control Powerpoint by VBS Tag: 200309
MS Debugger use
I downloaded the MS script debugger but I cannot figure out how to get it to
work with VBS scripts I have written.
I read the MS reference material but there is no step by step description of
how the debugger works. I can load a vbs file into the debugger but the "run"
selection is greyed out.
I made the changes to IE mentioned by MS but that does not seem to help.
What do I need to do? Tag: I would like to control Powerpoint by VBS Tag: 200308
How to make URLs with unique directory (like flick, delicious, techcrunch) (301 redirect ?)
Hi,
I have an ASP website (http://www.grazeit.com) with parameters sent
from one page to another.
My most important page is backpage.asp - complete path is
www.grazeit.com/backpage.asp?BPID=N (where N = 1,2,3, any available
number).
I would like to change the URL structure to be without asp extension
and visible parameters (like in www.flickr.com, for example).
Example:
Instead of http://www.grazeit.com/Backpage.asp?BPID=82
I would like the URL to be
http://www.grazeit.com/backpages
I understood that I should locate the file backpage.asp in the
subdirectory http://www.grazeit.com/backpages and rename it to be
default.asp
That works OK -
BUT how do I pass parameters to this new structure?
Thanks,
Gabi Tag: I would like to control Powerpoint by VBS Tag: 200307
Where can I get wshAPIToolkit?
I've seen a number of interesting scripts that use wshAPIToolkit. Could
someone post a current URL for obtaining it?
Thanks,
-Paul Randall Tag: I would like to control Powerpoint by VBS Tag: 200305
ADSI Script to populate numerous attributes
I want to modify some attributes in ADUC, more specifically for all
user accounts in the domain I want to pull in 4 columns from a csv or
xls file that populates the corresponding attributes of each user
account in Organization: fields = Deparment and Company
For example, if I have the csv file containing column 1 containing
username, column 2 containing Department data and column 3 containing
Company data and number 4 = "Manager" I have this script which gives
me all 3, but can't seem to get the Manager attribute to populate.. can
any offer any suggestions??
Const ADS_SCOPE_SUBTREE = 2
Set rootDSE = GetObject("LDAP://rootDSE")
sADSPath = rootDSE.Get("defaultNamingContext")
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Users.xls")
objExcel.Visible = False
i = 1
Do Until objExcel.Cells(i, 1).Value = ""
strName = objExcel.Cells(i, 1)
strDept = objExcel.Cells(i, 2)
strCO = objExcel.Cells(i, 3)
objCommand.CommandText = _
"SELECT aDSPath FROM 'LDAP://" & sADSPath & "' " & "WHERE
objectCategory='user' " & _
"AND samAccountName='" & strName & "'"
Set objRecordSet = objCommand.Execute
If objRecordSet.RecordCount = 1 Then
strUser = objRecordSet.Fields("aDSPath").Value
Set objUser = GetObject(strUser)
objUser.Put "Department", strDept
objUser.Put "Company", strCO
objUser.SetInfo
Else
objExcel.Cells(i, 4) = "Not found"
End If
i = i + 1
objRecordSet.Close
Loop
objConnection.Close
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit
Set objUser=Nothing
Set objExcel=Nothing
Set objWorkbook=Nothing
Set objRecordSet=Nothing
Set objCommandText=Nothing
Set objConnection=Nothing Tag: I would like to control Powerpoint by VBS Tag: 200301
Creating a table from within a Module in MS access
All,
I have been searching for a simple example, or any example for that matter, of how one would create a table from a Module and not from a Make Table Query. If anyone knows of such a beast I would greatly appreciate the URL. Thanks in advance. - CES Tag: I would like to control Powerpoint by VBS Tag: 200289
drive mapping script - please tell me what I am missing
Line wraps may make this hard to read, I hope someone can help me, please..
With the drive letter mapped, this seems to go right past the REMOVE line,
but still displays the message that the new drive was mapped. If I remove
the MAP line, it will remove the drive and display the message, the next run
maps the drive. Then I remap the drive to something else and start testing
all over again, but it seems that the 2 lines <<Just found a fix, will post
at the end... >>> Can someone explain this???? PLEASE
Option Explicit
Dim strDriveLetter, strRemotePath
Dim objNetwork, objShell
Dim CheckDrive, AlreadyConnected, intDrive
strDriveLetter = "P:"
strRemotePath = "\\svrtest\my software"
Set objShell = CreateObject("WScript.Shell")
Set objNetwork = CreateObject("WScript.Network")
Set CheckDrive = objNetwork.EnumNetworkDrives()
On Error Resume Next
AlreadyConnected = False
For intDrive = 0 To CheckDrive.Count - 1 Step 2
If CheckDrive.Item(intDrive) =strDriveLetter Then AlreadyConnected =True
Next
If AlreadyConnected = True then
objNetwork.RemoveNetworkDrive strDriveLetter
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
objShell.PopUp "Drive " & strDriveLetter & " is now connected to " &
strRemotePath
Else
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
objShell.PopUp "Drive " & strDriveLetter & " connected successfully."
End if
WScript.Quit
SWAPPED these 2 lines
objNetwork.RemoveNetworkDrive strDriveLetter
objShell.PopUp "Drive " & strDriveLetter & " is now connected to " &
strRemotePath
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
================================ Tag: I would like to control Powerpoint by VBS Tag: 200285
need to query AD and Exchange attributes
hi everyone. been struggling with this for way too long now. i simply need
to write a script that will take an AD account name as input, and report on
2 things for that user: Exchange mailbox size limit, and current mailbox
size.
Bharat, an MVP in here got me a good start a few days ago but im still
struggling. i guess what im looking for is an example... i cant figure out
how to determine limit if the limit is imposed by a policy in exchange.
supposedly there are attributes called msExchangePolicyList and
msExchangePolicyListBL that i should be looking at, but i dont even know
where they exist... theyre certainly not part of an AD user object. so
again... i think you all for pointing me in the right direction but if some
could show me a quick example of what i need to do i would GREATLY
appreciate it!
thank you Tag: I would like to control Powerpoint by VBS Tag: 200283
Count\list files in a folder
I've got a batch file that will move files from a folder to an archive
folder, create more html files and put them in the folder it just cleaned
up. Then email certain people a link to that folder.
The batch file calls a couple of vb scripts, one to do the emailing and one
to clean up the archive folder.
I would like to modify it so it will put in the email the number of files or
the partial name of the files it creates and puts in the folder. Ideally I
would like to have a partial name of the file written to the body of the
email but I guess I can live with the number of files.
Novice at scripting, I've gotten this far by copying and modifying other vb
scripts.
Can someone get me started?
TIA
DDS Tag: I would like to control Powerpoint by VBS Tag: 200279
Reading flat text produces ascii characters
I am creating a text file then reading it back but when I echo what I
have read, I get ascii characters. The text file looks exactly as I
expect it too in an editor. What am I doing wrong?
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
(TempFile, ForReading)
strText = objTextFile.ReadAll
objTextFile.Close
arrComputers = Split(strText, vbCrLf)
For Each strComputer in arrComputers
Wscript.Echo strComputer
Next
Wscript.Echo "Finished"
James
P.S.
This is basically taken from the MSscripting guys Tag: I would like to control Powerpoint by VBS Tag: 200273
Cant seem to pot to microsft.public.scripting.wsh
I can post to this and other groups but when I post to
Microsoft.public.scripting.wsh I get this error
Outlook Express could not post your message. Subject 'Re: Newbe question:
Common Dialog', Account: 'msnews.microsoft.com', Server:
'msnews.microsoft.com', Protocol: NNTP, Port: 119, Secure(SSL): No, Error
Number: 0x800C006F
Any one else getting the same? Tag: I would like to control Powerpoint by VBS Tag: 200271
How To Customize Internet Explorer Image Toolbar
Does anybody know how to programmatically customize the Internet Explorer
Image Toolbar (that toolbar that is shown when you go with your mouse over a
picture in IE), using VbScript?
manfred Tag: I would like to control Powerpoint by VBS Tag: 200267
Best way to get event logs.
What is the easiest way to get just Errors in System and the Application
event logs and dump them to a text file to be read later?
Script, utility?
Thanks Tag: I would like to control Powerpoint by VBS Tag: 200261
variable for home directory
My script is below. I have two questions.
1. If Object.File("H:" & "\" & user & ".doc")
H: is mapped to the user's home share. Is there a variable for home share
(the vb equivelant to %homeshare%)?
2. serverpath = file://S047-s0371-01/047users$/diplomas/
Sorry, I have forgotten names, but several people in this news group helped
me with this script. One person gave me this line. Are the forward slashes
correct (rather then back slashes?). Is the line basically just a hyperlink
to the directory named?
CODE
****************************************************************************
On Error Resume Next
'*** Declarations ***
Dim Shell,FSO,Network,word
'*** Objects ***
Set Network = WScript.CreateObject("WScript.Network")
Set Shell = WScript.CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
'Begin printer setup section
Dim oNet
Set oNet = CreateObject("WScript.Network")
Dim strComputerName
strComputerName = oNet.ComputerName
If InStr(strComputerName, "047-C303") > 1 Then
Net.AddWindowsPrinterConnection "\\S047-S0371-01\C303"
Net.setdefaultprinter "\\S047-S0371-01\C303"
End If
If InStr(strComputerName, "047-C309") > 1 Then
Net.AddWindowsPrinterConnection "\\S047-S0371-01\C309"
Net.setdefaultprinter "\\S047-S0371-01\C309"
End If
If InStr(strComputerName, "047-C310") > 1 Then
Net.AddWindowsPrinterConnection "\\S047-S0371-01\C310"
Net.setdefaultprinter "\\S047-S0371-01\C310"
End If
If InStr(strComputerName, "047-C312") > 1 Then
Net.AddWindowsPrinterConnection "\\S047-S0371-01\C312"
Net.setdefaultprinter "\\S047-S0371-01\C312"
End If
If InStr(strComputerName, "047-C110") > 1 Then
Net.AddWindowsPrinterConnection "\\S047-S0371-01\C110"
Net.setdefaultprinter "\\S047-S0371-01\C110"
End If
If InStr(strComputerName, "047-C111") > 1 Then
Net.AddWindowsPrinterConnection "\\S047-S0371-01\C111"
Net.setdefaultprinter "\\S047-S0371-01\C111"
End If
If InStr(strComputerName, "047-LIB") > 1 Then
Net.AddWindowsPrinterConnection "\\S047-S0371-01\Lib"
Net.setdefaultprinter "\\S047-S0371-01\Lib"
End If
If InStr(strComputerName, "047-LIB1") > 1 Then
Net.AddWindowsPrinterConnection "\\S047-S0371-01\Lib1"
Net.setdefaultprinter "\\S047-S0371-01\Lib1"
End If
'End printer section
'Begin document creation section
serverpath = file://S047-s0371-01/047users$/diplomas/
user = inputbox("Please enter your 6 DIGIT EXAM NUMBER")
'Check to see if the users's document already exists. The document may
already exist if 'this is the second time a user is logging in if (for
example) the computer crashed and 'needed to be rebooted). In that case,
the user's existing document is opened.
If Object.File("H:" & "\" & user & ".doc")
Then Word.Documents.Open("H" & "\" & user & ".doc")
Else
fso.copyfile serverpath & "diplomas.doc","H:" & "\" & user & ".doc"
Set Word = CreateObject ("Word.Application")
Word.Visible = TRUE
Word.Documents.Open("H:" & "\" & user & ".doc")
'End document creation section
wscript.quit Tag: I would like to control Powerpoint by VBS Tag: 200260
Dynamic Array
I'm having problems accessing the dynamic array below. The MsgBox
inside the loop in the subroutine "ReadCSVFile" I get the correct value
for index 1 for "arrFieldName". Any other attempt to access that array
index, even the one at the end of the subroutine, returns blank. I'm
obviously doing something bone headed here but I can't figure it out
' VB Script Document
option explicit
Dim objFSO
ReDim arrPrompt(0), arrFieldName(0), arrTyp(0), arrSize(0), arrDesc(0),
arrDef(0)
ReDim arrCusLay(0), arrLayField(0), arrInst(0), arrExcpt(0)
' Fileopen constants
Const ForReading = 1
Const ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
ReadCSVFile ("cusmas_form4.csv")
Sub ReadCSVFile ( TableName )
Dim i, arrRecord
Dim objInFile
Set objInFile = objFSO.OpenTextFile(TableName, ForReading)
ReDim arrPrompt(0)
ReDim arrFieldName(0)
ReDim arrTyp(0)
ReDim arrSize(0)
ReDim arrDesc(0)
ReDim arrDef(0)
ReDim arrCusLay(0)
ReDim arrLayField(0)
ReDim arrInst(0)
ReDim arrExcpt(0)
i=0
Do Until objInFile.AtEndOfStream
arrRecord = split(objInFile.ReadLine, "|")
arrPrompt(i)= arrRecord(0)
arrFieldName(i) = arrRecord(1)
arrTyp(i) = arrRecord(2)
arrSize(i) = arrRecord(3)
arrDesc(i) = arrRecord(4)
arrDef(i) = arrRecord(5)
arrCusLay(i) = arrRecord(6)
arrLayField(i) = arrRecord(7)
arrInst(i) = arrRecord(8)
arrExcpt(i) = arrRecord(9)
if ( i = 1 ) then
MsgBox(arrFieldName(1))
end if
i=i+1
ReDim arrPrompt(i)
ReDim arrFieldName(i)
ReDim arrTyp(i)
ReDim arrSize(i)
ReDim arrDesc(i)
ReDim arrDef(i)
ReDim arrCusLay(i)
ReDim arrLayField(i)
ReDim arrInst(i)
ReDim arrExcpt(i)
loop
MsgBox(arrFieldName(1))
End Sub Tag: I would like to control Powerpoint by VBS Tag: 200255
Automate IE popup dialog password input
I am trying to automate data download from a site that requires a
usename and password. I first started with XMLHTTP but I am stuck
without support from the site on how to parse the POST request.
I have also tried using an IE object, but how do I get it to input the
username and password into the windows popup dialog? Tag: I would like to control Powerpoint by VBS Tag: 200251
Manual click vs. automated click gives different result?
I'm going to a webpage and clicking on a link to download a file. The
webpage HTML for the link is
<SPAN
class=Menu
onClick='ExportReport()"
onKeyPress="CheckKeyPressed('ExportReport')"
onfocus="MenuFocus()"
onblur="MenuBlur()"
hidefocus=true
title="Exports the report data and column headings to a CSV file."
tabindex=0
accesskey=2
id=mnuExport>Export</SPAN>
The ExportReport() function is defined in the webpage header as
Sub ExportReport
' Export the form by re-calling this page with export=yes
document.frmReport.Action=" ...webpage URL... "
document.frmReport.export.value="yes"
document.frmReport.submit
End Sub
When I manually click on the link, I get the usual "File Download"
message box asking if I want to open the file, download the file, or
cancel. However, when I try to automate the process using the
following VBScript code
Set objIE = CreateObject( "InternetExplorer.Application" )
objIE.Navigate " ...webpage URL... "
Set objExport = objIE.Document.GetElementByID( "mnuExport" )
objExport.Click
instead of getting the "File Download" message box, the original
webpage is just reloaded. Can anyone tell me what I am doing wrong?
I'm using Internet Explorer 6, in case it matters. Thanks in advance
to all who respond. Tag: I would like to control Powerpoint by VBS Tag: 200239
Finding duplicates
Hi,
I have a script which opens up MSI packages in a directory and
subdirectories. It extracts all the component GUID information and
writes one column for each package to an Excel spreadsheet.
For each column:
Row 1 is the package name.
Row 2 is the productcode of the package
Row 3 is blank
Row 4 is the start of the component GUIDs
Each column may be a different length.
I have to check for duplicate component GUIDs between the columns, and
report back which component GUIDS are duplicated in which columns. What
is the best way to do this?
Many thanks.
Matt Tag: I would like to control Powerpoint by VBS Tag: 200238
Some questions about VBscript in outlook
how do I do if I want to check the status of a checkbox when I click
save and close in an appointment, and then if its true, add some text
to the subject field? Tag: I would like to control Powerpoint by VBS Tag: 200236
Monitor opening of particular extension
How can I monitor files with a particular extension. If the files are
opened it pops up with a message box with a yes or no button. Yes opens
the file no stops the files from opening.
any ideas greatly appreciated Tag: I would like to control Powerpoint by VBS Tag: 200230
How to obtain computer name longer than 15 characters?
How can I obtain the longer computer name of a computer via vbscript?
All techniques I've seen so far only return the NetBIOS name, which is
15 characters max. Windows has supported computer names up to 63
characters long since at least Windows 2000. Most computers on my
network have computer names longer than 15 characters.
Thanks.
Brent Gardner
Network Administrator
IPRO Tech, Inc. Tag: I would like to control Powerpoint by VBS Tag: 200228
Hi all
Hi,
I want to be able to put this in a script and put it on the desktop:
C:\WINDOWS>psexec -d -i -e -u Administrator cmd /c start sysdm.cpl
What would be the current cyntax to run this as a vbs script?
Thanks,
SA. Tag: I would like to control Powerpoint by VBS Tag: 200227
Using XML DOM to update machine.config
Hello all.
The following lines are an excerpt from a machine.config file:
<configuration>
<system.net>
<connectionManagement>
<add address="*" maxconnection="10"/>
</connectionManagement>
</system.net>
<system.web>
<processModel
enable="true"
timeout="Infinite"
idleTimeout="Infinite"
shutdownTimeout="0:00:05"
requestLimit="Infinite"
requestQueueLimit="5000"
restartQueueLimit="10"
memoryLimit="60"
webGarden="false"
cpuMask="0xffffffff"
userName="machine"
password="AutoGenerate"
logLevel="Errors"
clientConnectedCheck="0:00:05"
comAuthenticationLevel="Connect"
comImpersonationLevel="Impersonate"
responseDeadlockInterval="00:03:00"
maxWorkerThreads="100"
maxIoThreads="100"
minWorkerThreads="50"
/>
</system.web>
</configuration>
I'm using the following VBScript to edit the machine.config file and
change the "maxconnection" value from 10 to 48:
Dim strServer, XMLFilePath, XMLFileName, XMLFile, XMLFileBak
strServer = "000-WEB15-CRS"
XMLFilePath = "\\" & strServer & _
"\C$\Winnt\Microsoft.NET\Framework\v1.1.4322\CONFIG\"
XMLFileName = "machine.config"
XMLFile = XMLFilePath & XMLFileName
XMLFileBak = XMLFileName & "_Backup_" & ".txt"
Set xmlDoc = CreateObject("Msxml.DOMDocument")
xmlDoc.async = False
xmlDoc.PreserveWhitespace = True
xmlDoc.load XMLFile
'~~~ Create backup of original XML file
Set objFSO = CreateObject("Scripting.FileSystemObject")
CreateObject("Scripting.FilesystemObject") _
.GetFile(XMLFile).Name = XMLFileBak
Dim strNode, strKeyName, strNewValue
strNode = "/*/*/*/*[@address=" & Chr(34) & "*" & Chr(34) & "]"
strKeyName = "maxconnection"
strNewValue = "48"
Set objNode = xmlDoc.selectSingleNode (strNode)
objNode.setAttribute strKeyName, strNewValue
xmlDoc.Save XMLFile
Set xmlDoc = nothing
Set objFSO = nothing
Set objNode = nothing
The script works fine, except for one thing. The whitespace appears to
be preserved throughout the machine.config file - except for the
"<processModel" section. This section gets changed - the entire section
ends up on one horizontal line:
<processModel enable="true" timeout="Infinite"
idleTimeout="Infinite" shutdownTimeout="0:00:05"
requestLimit="Infinite" requestQueueLimit="5000" restartQueueLimit="10"
memoryLimit="60" webGarden="false" cpuMask="0xffffffff"
userName="machine" password="AutoGenerate" logLevel="Errors"
clientConnectedCheck="0:00:05" comAuthenticationLevel="Connect"
comImpersonationLevel="Impersonate" responseDeadlockInterval="00:03:00"
maxWorkerThreads="100" maxIoThreads="100" minWorkerThreads="50"/>
Any idea what's causing this? Any help would be greatly appreciated.
Thanks!
- Dave Tag: I would like to control Powerpoint by VBS Tag: 200225
On Not in List script problem
Thanks in advance for any help!
I have the following script for a field called DialUpAccess in my Microsoft
Access database. This is a combo box that can look up entered values
(repeating values) or should allow values that were not previously not in
the list to be added.
The properties of the combo box are listed below:
The Control Source is 'DialUpAccess'
The Row Source Type is 'Value List'
The Row Source has this, "NetOP";"PC Anywhere";"RAS"
Limit to list is 'No'
Auto Expand is 'Yes'
Enabled is 'Yes'
Locked is 'No'
The 'On Not in List' event procedure is listed below:
Private Sub ComboDialup_NotInList(NewData As String, Response As Integer)
'Adds a remote access type that is not in the list to the list, if the user
wishes to do so.
Dim strMessage As String
Dim intAnswer As Integer
strMessage = "'" & [NewData] & "' is currently not in your list. Do you wish
to add it?"
intAnswer = MsgBox(strMessage, vbOKCancel + vbQuestion)
If intAnswer = 1 Then
Set dbsVBA = CurrentDb
Set rstKeyWord = dbsVBA.OpenRecordset("Hardware")
rstKeyWord.AddNew
rstKeyWord!ComboDialup = NewData
rstKeyWord.Update
Response = acDataErrAdded
Else
Response = acDataErrDisplay
End If
End Sub
Does anyone know what my problem here is?
Thanks again, Randy Tag: I would like to control Powerpoint by VBS Tag: 200224
VBScript Create AD users
I am making a script that programatically creates user accounts in
Active Directory. I can create users without any problems. The issue
is I would like to append a # to the user ID if it already exists in
AD. For Example, jsmith already exists so if Joe Smith joins the
company his samAccountName should be jsmith2. I cannot get that part
of the scripting. If anyone has a code snippet related to that issue
it would be greatly appreciated. Just as a note: I cannot pull from
Excel so altering the id's there is out. I need it to all be contained
in the script. Tag: I would like to control Powerpoint by VBS Tag: 200223
Preventing interruptiong of Logon Script
Hello any and all knowledgable script writers:
I am hoping you can help me with a vbs login script I am writing to map
network drives. I am done, but the only problem I am facing is that if
the user cannot touch the computer (i.e. launch outlook) because the
script is interrupted and it doesn't map the drives. Is it possible
to code something that will render any user input void until the script
is completed running? I guess the question is, what do I need to add to
the vbs to make the script uninterruptible? Any and all help is greatly
greatly appreciated!! Thank you!
-- Marivi Tag: I would like to control Powerpoint by VBS Tag: 200221
how to add category to contact
How do I access outlook 2003 contacts in a contact folder and add category
by vbscript of course?
I suppose I can open the outlook object. I am stuck searching for reference
and sample.
Please help. thank you for your time Tag: I would like to control Powerpoint by VBS Tag: 200220
Trouble with UserAccounts.CommonDialog and Multiple File Selection
Hey y'all,
I've been reading and reading and I can't get this to work. I want to
select multiple files from a dialog and then do stuff to them. Here's
the code I am using:
Sub Command1_Click()
Set objDialog = CreateObject("UserAccounts.CommonDialog")
objDialog.Filename = ""
objDialog.Filter = "All Files|*.*"
objDialog.Flags = &H200 + &H80000 + &H200000
objDialog.ShowOpen
FileNames = Split(objDialog.Filename, vbNullChar)
MsgBox FileNames(0)
MsgBox FileNames(1)
End Sub
Result: After running this and selecting two files, FileNames(0)
contains the path and I get an error at MsgBox FileNames(1) saying it
is out of range. Suggestions?
Lost and Hopeless,
Drew Tag: I would like to control Powerpoint by VBS Tag: 200219
Login Script
HI guys and gals,
I'm trying to get a login script I have put together working... It's an
amalgamation of scripts I have found online. My goals are:
1: Automate Network Printer deployment based upon user group
membership. Printer lists will be stored in text files, one for each
group.
2: Automate Network Drive deployment, again based on group membership.
Network shares and drive letters are specified in a text file.
3: Display a login prompt.
I've almost got this working but there are a couple of problems:
1: Printer assignment works, but the text file must be in alphabetical
order... maybe there is a better way to do this? Possibly using a
similar loop to the Netwrk Share
2: The network share is not working at all. I had it working simillaly
to the printer Sub but noticed the alphabetical problems .
Any help with this would be greatly apreciated.
I have pasted the code below to the script... it is long. Below this
are examples of the text files.
========================================================================
'Test VBS Login Script
'*******Determin Active Directory Account Information by binding to the
user object in AD***********
' Constants for the NameTranslate object.
Const ADS_NAME_INITTYPE_DOMAIN = 1
Const ADS_NAME_TYPE_NT4 = 3
Const ADS_NAME_TYPE_1179 = 1
Dim Filesystem
Dim InPutFile
Dim arrname
Dim clPrinters
Dim strPrinterName
Dim printer_file
Dim network_share_file
Dim strNetworkShare
Dim strDriveLetter
Dim clshares
Set objNetwork = CreateObject("Wscript.Network")
'Retrieve Computer Name
strComputerName = objNetwork.ComputerName
' Retrieve user NT logon name.
strNTName = objNetwork.UserName
' 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_TYPE_NT4, strDNSDomain
objTrans.Set ADS_NAME_TYPE_1179, strDNSDomain
strNetBIOSDomain = objTrans.Get(ADS_NAME_TYPE_NT4)
' Remove trailing backslash.
strNetBIOSDomain = Left(strNetBIOSDomain, Len(strNetBIOSDomain) - 1)
' Use the NameTranslate object to convert the NT user name to the
' Distinguished Name required for the LDAP provider.
objTrans.Init ADS_NAME_INITTYPE_DOMAIN, strNetBIOSDomain
objTrans.Set ADS_NAME_TYPE_NT4, strNetBIOSDomain & "\" & strNTName
strUserDN = objTrans.Get(ADS_NAME_TYPE_1179)
' Bind to the user object in Active Directory with the LDAP provider.
Set objUser = GetObject("LDAP://" & strUserDN)
' Display various names.
'************** Find current time and date and display login
prompt****************************
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_LocalTime")
For Each objItem in colItems
intMonth = objItem.Month
intDay = objItem.Day
intYear = objItem.Year
dtmDate = intMonth & "/" & intDay & "/" & intYear
intHour = objItem.Hour
If intHour < 12 Then
text1 = "Morning"
ElseIf intHour => 12 And intHour < 18 Then
text1 = "Afternoon"
ElseIf intHour > 18 Then
text1 = "Evening"
End If
intMinutes = objItem.Minute
If intMinutes < 10 Then
intMinutes = "0" & intMinutes
End If
intSeconds = objItem.Second
If intSeconds < 10 Then
intSeconds = "0" & intSeconds
End If
dtmTime = intHour & ":" & intMinutes & ":" & intSeconds
MsgBox ("Good " & text1 & " " & objUser.givenName & " " &
objUser.sn & " and welcome to the Spicers European Network." _
& vbCRLF _
& vbCRLF & "You are logging into computer " & strNetBIOSDomain &
"\" & strComputerName & "." & vbCRLF _
& vbCRLF & "The current date and time is: " & dtmDate & " " &
dtmTime _
& vbCRLF _
& vbCRLF & "Please note that all system usage is monitored and that
by clicking OK below, you"_
& vbCRLF & "confirm that you understand & accept this as part of
the SPICERS IT User Policy."_
& vbCRLF & "Please note that this policy is subject to periodic
update and you are advised"_
& vbCRLF & "to refresh yourselves with the contents of the policy
on a regular basis."_
& vbCRLF _
& vbCRLF & "A copy of the IT User Policy can be found in:"_
& vbCRLF & "Public folders/Employee policies & Procedures/IT User
Policy - Spicers Limited")
Next
'*******Establish group membership and process script based upon AD
group Membership***********
If IsMember("Domain Admins") Then
WScript.Echo "Member of Domain Admins = Yes"
printer_file = "domain_admins_printers.txt"
Install_NetPrinters
Install_Printer
network_share_file = "domain_admins_shares.txt"
Install_NetShares
Install_Share
End If
If IsMember("Retriever") Then
WScript.Echo "Member of Retriever = Yes"
Else
WScript.Echo "Member of Retriever = No"
End If
If IsMember("Euro") Then
WScript.Echo "Member of Euro = Yes"
Else
WScript.Echo "Member of Euro = No"
End If
Function IsMember(strGroup)
' Function to test one user for group membership.
' objUser is the user object with global scope.
' strGroup is the NT Name of the group to test.
' objGroupList is a dictionary object with global scope.
' Returns True if the user is a member of the group.
Dim objGroup
If IsEmpty(objGroupList) Then
Set objGroupList = CreateObject("Scripting.Dictionary")
objGroupList.CompareMode = vbTextCompare
For Each objGroup In objUser.Groups
objGroupList(objGroup.sAMAccountName) = True
Next
End If
IsMember = objGroupList.Exists(strGroup)
End Function
'********************************* Printers Functions
********************
Sub Install_NetPrinters
Set clPrinters = objNetwork.EnumPrinterConnections
Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject")
ForReading = 1
Set InPutFile = FileSystem.OpenTextFile(printer_file,ForReading, False)
'Overwrite Flag
intInstallPrinterFlag = 0
End Sub
Sub Install_Printer
While not InPutFile.atEndOfStream
If clPrinters.Count <= 0 Then
uname = InPutFile.ReadLine()
arrname = Split (uname,"")
strPrinterName = arrname(0)
Wscript.Echo "Printer: " &
strPrinterName & " Does Not Exist"
objNetwork.AddWindowsPrinterConnection
strPrinterName
'To Set this printer as a default
printer enable the next line
'objNetwork.SetDefaultPrinter
strPrinterName
WScript.Echo "Installing " &
strPrinterName
'Now, if there is a printer installed
and the install printer flag
is set, then remove the existing printer and re-install it.
ElseIf clPrinters.Count > 0 Then
'To display current printers
For i = 0 to clPrinters.Count -1 Step 2
Wscript.Echo "Query returned: "
& clPrinters.Item (i + 1)
uname = InPutFile.ReadLine()
arrname = Split (uname,"")
strPrinterName = arrname(0)
If lcase(clPrinters.Item (i +
1)) = lcase(strPrinterName) then
Wscript.Echo "Printer
connection to " & strPrinterName & "
Exists, checking Re-Install Flag"
If
intInstallPrinterFlag = 1 Then
WScript.Echo
"Printer connection to " & strPrinterName &
"exists, re-install flag SET. Removing and re-installing."
objNetwork.RemovePrinterConnection strPrinterName
objNetwork.AddWindowsPrinterConnection strPrinterName
WScript.Echo
"Installing " & strPrinterName
Else
WScript.Echo
"Printer connection to " & strPrinterName &
"exists, but re-install flag NOT SET, discarding."
End If
Else
Wscript.Echo "Printer
connection to " & strPrinterName & " does
not exist"
objNetwork.AddWindowsPrinterConnection strPrinterName
WScript.Echo
"Installing " & strPrinterName
End If
Next
'If Exist
objNetwork.WindowsPrinterConnection strPrinterName Then
'WScript.Echo "PRINTER DOES NOT EXIST,
INSTALLING"
'objNetwork.AddWindowsPrinterConnection
strPrinterName
'ElseIf
'To Set this printer as a default
printer enable the next line
'objNetwork.SetDefaultPrinter
strPrinterName
End If
Wend
'Clean Up
Set InPutFile = Nothing
Set FileSystem = Nothing
uname = Nothing
arrname = Nothing
strPrinterName = Nothing
End Sub
'***********************************************************************************************
'*************************** Network Drive Sub
********************************************
'Can be the same as above but needs to use network_share_file variable
for the InPutFile
Sub Install_NetShares
Wscript.Echo "Running Install_NetShares"
Set Filesystem = WScript.CreateObject("Scripting.FileSystemObject")
ForReading = 1
Set InPutFile = Filesystem.OpenTextFile(network_share_file,ForReading,
False)
Wscript.Echo network_share_file
End Sub
Sub Install_Share
Wscript.Echo "Running Install_Share"
'Overwrite Flag
intRemapShare = 1
Set fso = CreateObject("Scripting.FileSystemObject")
While not InPutFile.atEndOfStream
Wscript.Echo "Running While Loop"
For Each d in fso.drives
If d.sharename <> "" Then
wscript.echo d.driveletter,
d.sharename
'Wscript.Echo "Query returned:
" & clshares.Item (i + 1)
uname = InPutFile.ReadLine()
arrname = Split (uname,",")
strDriveLetter = arrname(0)
strNetworkShare = arrname(1)
If lcase(d.sharename) =
lcase(strNetworkShare) then
Wscript.Echo "Network
Drive connection to " & strNetworkShare &
" exists, checking Re-Install Flag"
If intRemapShare = 1
Then
WScript.Echo
"Network Drive connection to " & strNetworkShare &
" exists, re-install flag SET. Removing and re-installing."
WScript.Echo
"Removing: " & strDriveLetter & ":"
objNetwork.RemoveNetworkDrive strDriveLetter & ":",True
WScript.Echo
"Drive Removed"
WScript.Echo
"Mapping " & strNetworkShare
objNetwork.MapNetworkDrive strDriveLetter & ":",
strNetworkShare
Else
WScript.Echo
"Network Drive connection to " & strNetworkShare &
" exists, but re-install flag NOT SET, discarding."
End If
Else
Wscript.Echo "Network
Drive connection to " & strNetworkShare &
" does not exist"
WScript.Echo "Mapping "
& strNetworkShare
objNetwork.MapNetworkDrive strDriveLetter & ":", strNetworkShare
WScript.Echo "Done "
End If
Else
MsgBox "Crap"
uname = InPutFile.ReadLine()
arrname = Split (uname,"")
strDriveLetter = arrname(0)
strNetworkShare = arrname(1)
Wscript.Echo "Network Drive
connection to: " & strNetworkShare &
" Does Not Exist"
WScript.Echo "Mapping " &
strNetworkShare
objNetwork.MapNetworkDrive
strDriveLetter & ":", strNetworkShare
End if
Next
Wend
msgbox "While End"
'Clean Up
Set InPutFile = Nothing
Set fso = Nothing
uname = Nothing
arrname = Nothing
strNetworkShare = Nothing
intRemapShare = Nothing
End Sub
=======================================================================
domain_admins_shares.txt:
V,\\SPICFP\DomAdmins$\BradfordC
J,\\SPICFP\NETLOGON
domain_admins_printers.txt:
\\spicprt\XPSYS_PRINT1
\\spicprt\OPS$PRINT
This is a first attempt at WSH, so forgive any silly errors.
I am trying to detect currently installed Shares and
Printers in order to avoid re-installing them unless a reInstall flag
is set.
Thanks again :)
-Chris Tag: I would like to control Powerpoint by VBS Tag: 200214
Copying email attachments to a specific folder
Is there a way to set up a script that will look in a folder (in Microsoft
Outlook), and do the following:
1) See if there's a message in it (a rule is already set up to copy
messages from a particular sender to that folder).
2) If it's there to copy the attachment to a specific folder on my Windows
2003 server.
3) Rename the attachment with that of the subject line.
4) Delete the e-mail from the folder.
Any suggestions?
Thanks,
Glenn Tag: I would like to control Powerpoint by VBS Tag: 200212
Automate Interaction With Webpage
Hello,
I am trying to automate an interface to this website:
http://www.class.noaa.gov/nsaa/products/upload which conforms to the
DOM.
I have managed to login and to load all document elements into an
object collection, but am having difficulties interacting with these
elements beyond the .Click() method.
1) Presuming I have loaded all elements on the page into oCollection. I
then try to search through the elements Name property to match
"uploaded_file" which is the input_file object.
iCount = 0
Do
Set oElement = oCollection(iCount)
iCount = iCount + 1
Loop Until oElement.Name = "uploaded_file"
The above code does not work. Is it because some elements on the page
do not have a Name property? How to Fix?
2) If I manage to find the correct object will the following code be
enough to set the file to upload and move on to the next page?
oElement.Value = filename
oElement.Click()
3) Is there a more simple way to set/get element name/property pairs
that having to parse the entire page? I know the element's name is
"upload_file".
4) There are two submit button on the page, but only one is named. How
do I find and activate the unnamed one?
5) Is it better to use the Microsoft.XMLHTTP object for my purposes?
6) Can anyone point me to an online reference relevant to what I am
trying to do that is more illustrative than the MSDN pages? I do not
know exactly what the topic should be. Is it DOM, ASP or something
else? I need a gentle primer.
Thanks Tag: I would like to control Powerpoint by VBS Tag: 200210
VBScript That Checks To See If Folder Exists (Loop Of Computers)
I was wondering if anyone could help me create a VBScript the with
check a list of remote computers to see if a folder exist and input
that information in a text file it does or not Tag: I would like to control Powerpoint by VBS Tag: 200207
Create a Folder on the users Desktop
Im new to VBS Scripting, and I was assigned the task of converting our
batch files into VBSScript since we went to Active Directory 6 months
ago.
I can map drives and get a user and group membership (I think). But
what I am stumped at is checking for the existence of a LINKS folder on
the users desktop, and if it isnt there, create it. Then I need to dump
shortcuts and links into it depending on group membership.
In batch, I can use the %userprofile% command (in fact, here is a
snippet of batch that we use...)
Echo Checking Links Folder...
IF NOT EXIST "%userprofile%\desktop\Links" MKDIR
"%userprofile%\desktop\Links"
copy "\\DCSERVER\NETLOGON\LINKS\*.*" "%userprofile%\desktop\Links"
How could I make this into a logon script? This is one of the first
commands I use. Any help would be appreciated. I have looked for a VBS
Snippet on the net (Microsoft, VBSScripting.com and many others) but
could not find this. I can't believe I'm the only one who wants to do
this during login. Seems pretty basic to me that an Admin would want to
do this (at least in a K-12 school environment). Anyway Please help
me... Tag: I would like to control Powerpoint by VBS Tag: 200205
VB Wait...
Hi all,
Below is a section of VBA that I have written, and basically I would
like to
get rid of the application.wait lines of code and replace these with
code
that checks that the program in question (cmd.exe) is idle before
continuing.
If anybody can offer a suggestion as to how I can do this, or any other
method that would give good results, please let me know,
Private Sub CommandButton1_Click()
Shell ("C:\Windows\system32\cmd.exe")
Application.Wait Now + TimeValue("00:00:03")
SendKeys "net send " & (TextBox1) & " " & (TextBox2) & "{Enter}"
Application.Wait Now + TimeValue("00:00:05")
SendKeys "Exit" & "{Enter}"
Unload Me
End Sub
Many Thanks,
Mark Tag: I would like to control Powerpoint by VBS Tag: 200200
Different scripts at logon
I am very new to scripting. I would like to run different scripts at logon
for different users. Script "A" would run when user "A" logged on, script
"B" would run when user "B" logged on. Is this possible?
Thanks, Tag: I would like to control Powerpoint by VBS Tag: 200196
Inconsistent Results
Hello,
I have written a vbscript - actually an HTA, which checks to see if a
user is a member of an AD group. For some users it will correctly
return the correct results. For others it will say that a user is not a
member of a group when actually they are. When looking at group
membership through the Active Directory snap in it shows the correct
membership. At first I thought the issue might be something to do with
the Domain Controller the script was interrogating, however looking on
those DC's with the AD snap in also shows the correct membership. It is
worth mentioning that newer accounts dont seem to return the correct
results. The only thing that needs to be changed in the HTA is
"strNetBIOSDomain = "DOMAIN"" and replace DOMAIN with your correct
Domain name.
Here is my HTA:
<html>
<head>
<title>HTA Helpomatic</title>
<HTA:APPLICATION
ID="objHTAHelpomatic"
APPLICATIONNAME="HTAHelpomatic"
SCROLL="yes"
SINGLEINSTANCE="yes"
WINDOWSTATE="normal"
>
</head>
<SCRIPT Language="VBScript">
Sub RunScript
strGroup = group.value
strGroupText = group.value
strUser = user.value
Const ADS_NAME_INITTYPE_GC = 3
Const ADS_NAME_TYPE_NT4 = 3
Const ADS_NAME_TYPE_1779 = 1
Dim objTrans, objShell, objGroup
Set objShell = CreateObject("Wscript.Shell")
strNetBIOSDomain = "DOMAIN"
Set objTrans = CreateObject("NameTranslate")
objTrans.Init ADS_NAME_INITTYPE_GC, ""
objTrans.Set ADS_NAME_TYPE_NT4, strNetBIOSDomain & "\" & strUser
strUserDN = objTrans.Get(ADS_NAME_TYPE_1779)
objTrans.Set ADS_NAME_TYPE_NT4, strNetBIOSDomain & "\" & strGroup
strGroupDN = objTrans.Get(ADS_NAME_TYPE_1779)
'msgbox struserdn
'MsgBox strGroupDN
'MsgBox """" & "LDAP://" & strGroupDN & """"
'strGroupDN = """" & "LDAP://" & strGroupDN & """"
strGroupDN = "LDAP://" & strGroupDN
'MsgBox strGroupDN
Set objGroup = GetObject(strGroupDN)
objGroup.GetInfo
arrMemberOf = objGroup.GetEx("member")
StrCompare = struserdn
For Each strMember in arrMemberOf
intCompare = StrComp(StrCompare, strMember, vbTextCompare)
If intCompare = 0 Then
MsgBox "User is a member of the " & strGroupText & "
group",,"Group Information"
Exit For
End if
Next
If intCompare <> 0 Then
MsgBox "User is not a member of the " & strGroupText & " group",,"Group
Information"
End If
End sub
</SCRIPT>
<body>
<font color="red">
<face ="Times New Roman">
<H1 align="center"font color="red"> Is User Member of Group </H1>
<font color="blue" face="Times New Roman" size="4">User
<input type="text" name="User" size="25">
<font color="blue" face="Times New Roman" size="4">Group
<input type="text" name="Group" size="25">
<br>
<br>
<input id=runbutton class="button" type="button" value="Get Info"
name="run_button" onClick="RunScript">
</body>
</html>
Many thanks for any assistance,
Ben Tag: I would like to control Powerpoint by VBS Tag: 200194
Invoke interative process
I m using Win32_ScheduledJob to invoke interative process. May i know
how can i change the working directory, so that the .exe file can run
from that directory. Thanks.
-chailee- Tag: I would like to control Powerpoint by VBS Tag: 200192
2D VBScript Array from a String w/ Record and Field Delimiters
I've been struggling with generating a 2D array from a string. Perhaps
someone can shed some light on the process or point me in the right
direction...
The string in question looks something like this:
1[/field]Penguins[/field][/record]2[/field]Skuas[/field][/record]5[/field]Eagles,
Golden[/field][/record]
I know this is a rather odd string, but suffice it to say its generated
to represent a series of records which cannot be retrieved via typical
ASP/ADO recordset fashion. The environment is classic ASP using
VBScript.
I can readily break this up into a 1D array using
split(str,"[/record]").
But this yields only the 3 combined sets:
1[/field]Penguins[/field]
2[/field]Skuas[/field]
5[/field]Eagles, Golden[/field]
What I'm looking for is a way to make this a 2D array such that:
aryBirds(0,0) = 1
aryBirds(0,1) = Penguins
aryBirds(1,0) = 2
aryBirds(1,1) = Skuas
aryBirds(2,0) = 5
aryBirds(2,1) = Eagles, Golden
Unfortunately my searching thusfar hasn't hit on what looping is
required to get this 2D result.
So far I've tried things like
For i = 0 to Ubound(aryCombinedSets)-1
aryNewSets = split(aryCombinedSets(i),"[/field]")
For j=0 to Ubound(aryNewSets)-1
aryBirds(i,j) = (aryNewSets(j), j)
Next
Next
But these only generate the last 2 values of the array. That is only
the 5 and Eagles, Golden values are retrievable.
I have several similar strings. In each case I know how many fields
exist, but the number of records varies. In each case I need to make a
2D array so that values can be individually manipulated.
Any assistance or pointers in the right direction would be helpful.
Thanks!
Bonnie Tag: I would like to control Powerpoint by VBS Tag: 200188
ASP: using Chr to display big 5 character
I am using windows 2003 server english version. I got the folloing message
when I put a big5 code to CHR function to get a ANSI character
Microsoft VBScript runtime (0x800A0005)
Invalid procedure call or argument: 'Chr'
I found that i cannot pass a number greater than 255 to the function. The
code works before in windows 2000 server traditional chinese version. Is
there any function/code I could use to translate a 2-bytes big5 code to utf-8
code? Tag: I would like to control Powerpoint by VBS Tag: 200186
See if computer is active and connected
What's the best way to make a script that regularly checks to see if a
computer on the network is active and connected? I've been using a script
that does the simple ping cmd every 30 seconds, but I'd like something
proper and better.
Thanks Tag: I would like to control Powerpoint by VBS Tag: 200183
Task Scheduler & VBS
Hello!
I run a script using the Windows Task Scheduler with this comand line in
the job MyTask.job
wscript "d:\myscript.vbs"
That's fine!
But how can I know the name of the task who call the script? (in this
example, it would be MyTask.job).
I think I can use the log file of the Sheduler but does anyone know
another way to do this inside myscript.vbs ?
Thanks Tag: I would like to control Powerpoint by VBS Tag: 200178
IADsComputer [adsi] interface using vbscript conundrum
Can anyone please help me figure out what is missing from this Microsoft
documentation?
1) Reference:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/iadscomputer.asp
I have worked through the fact that the LDAP ADSI provider does not support
the IADsComputer interface; the documentation claims that "The IADsComputer
interface is not implemented by the LDAP ADSI provider".
However the properties "OperatingSystem" and "OperatingSystemVersion" *are*
available. Why?.
2) Reference:
http://msdn.microsoft.com/library/en-us/adsi/adsi/provider_support_of_adsi_interfaces.asp
Now, this is a great page because it summarises the fact that in order to
get the other IADsComputer methodes and properties, we need to use the WinNT
provider, which is detailed at this page:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/adsi_objects_of_ldap.asp
The documentation at this page does not clearly indicate whether the WinNT
provider is connecting to the actual physical computer or Active Directory
with the WinNT://<domain name>/<server> ADsPath string. Which is it?
3) Using the WinNT provider, the properties documented at this page (
http://msdn.microsoft.com/library/en-us/adsi/adsi/iadscomputer.asp ) are
supposed to be available, but they are NOT.
This has me very puzzled; I have checked the "Requirements" but find nothing
missing. I have been through the docs time & time again, but something is
missing! See below...
Example:
Set oADSystem = GetObject
("LDAP://DC001/CN=MYSVR,OU=domain_servers,dc=contoso,dc=msft")
Wscript.Echo "Active Directory Attributes"
Wscript.Echo "ADsPath:" & oADSystem.ADsPath
Wscript.Echo "Class:" & oADSystem.Class
Wscript.Echo "OperatingSystem:" & oADSystem.OperatingSystem
Wscript.Echo "OperatingSystemVersion:" & oADSystem.OperatingSystemVersion
Wscript.Echo
Set oPhSystem = GetObject ("WinNT://contoso.msft/MYSVR,Computer")
Wscript.Echo "Physical Machine Attributes"
Wscript.Echo "Name:" & oPhSystem.Name
Wscript.Echo "Model:" & oPhSystem.Model
Result:
Active Directory Attributes
ADsPath:LDAP://DC001/CN=MYSVR,OU=domain_servers,dc=contoso,dc=msft
Class:computer
OperatingSystem:Windows Server 2003
OperatingSystemVersion:5.2 (3790)
Physical Machine Attributes
Name:MYSVR
E:\Temp\adaudit\test.vbs(11, 1) Active Directory: The directory property
cannot be found in the cache.
(I have a hrd time believing the the server does not have a "Model"
attribute. Same error for the other properties: MemorySize, Processor,
ProcessorCount, StorageCapacity, etc.)
What am I missing? Anyone?
Thanks in advance
--Maarten Veerman Tag: I would like to control Powerpoint by VBS Tag: 200175
Bulk import DNS
Hello, I was wondering if anyone out there has a snippet that will do a
build the framework for a mass import of DNS entries (AD intigrated),
we need to add over 1700 entries.
Any help would be great.
Thanks.
Terry. Tag: I would like to control Powerpoint by VBS Tag: 200174
Remotely change Display Resolution Using script
Is there a way to create a script that will do the following?:
Create a list of computers that this script will affect. The script
would change Resolution from 1024x768 to 800x600 automatically. And I
would create another script to change it back. Tag: I would like to control Powerpoint by VBS Tag: 200173
Remotely change Display Resolution Using script
Is there a way to create a script that will do the following?:
Create a list of computers that this script will affect. The script
would change Resolution from 1024x768 to 800x600 automatically. And I
would create another script to change it back. Tag: I would like to control Powerpoint by VBS Tag: 200172
Using ADO DB to Manipulate Space Character Filled Strings
I'm attempting to use ADO to manipulate data in fixed width text files
as shown here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/f65b4a7c-eb8c-47f1-ba36-16ad8793026d.asp
The issue I run into is that the fields which are all spaces or have
trailing spaces end up with the spaces as null. Is there a way to
force the OLE DB provider to bring them in as space characters? For
example, store 2 spaces if the 2 character field is 2 spaces in the
fixed width import file.
Included below is an excerpt of my script and schema.ini file. I have
tried changing the field type to text in the .ini file and obtained the
same result.
Script:
On Error Resume Next
' Assign constants
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adCmdText = &H0001
Const FOR_APPENDING = 8
' Assign file string variables
strPathtoTextFile = "E:\Temp\"
strOutputTextFile = "temp.txt"
strToHostFile = "ALL_TOHOST.txt"
' Create ADO objects
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
' Create file system object for handling text files
Set objFSO = CreateObject("Scripting.FileSystemObject")
' Open output text file
Set objTextFile = objFSO.OpenTextFile _
(strPathtoTextFile & strOutputTextFile, FOR_APPENDING, True)
Wscript.Echo "Opening OLEDB Connection"
' Open connection for input text file with OLEDB driver
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strPathtoTextFile & ";" & _
"Extended Properties=""text;HDR=NO;FMT=FixedLength"""
Wscript.Echo "Selecting Records"
' Select records from input file
objRecordset.Open "SELECT * FROM " & strToHostFile, _
objConnection, adOpenStatic, adLockOptimistic, adCmdText
' Obtain field count
strFieldsCount = objRecordset.Fields.Count
' Build record string and write to file
If strFieldsCount > 0 Then
Do Until objRecordset.EOF
For intLoop = 0 To (strFieldsCount - 1)
strRecord = strRecord & objRecordset.Fields.Item(intLoop)
Next
objTextFile.WriteLine(strRecord)
strRecord = ""
objRecordset.MoveNext
Loop
End If
objTextFile.Close
Wscript.Echo "Script Complete"
Schema.ini
[ALL_TOHOST.TXT]
ColNameHeader = False
CharacterSet = ANSI
Format=FixedLength
Col1=FIELD1 char Width 1
Col2=FIELD2 char Width 2
Col3=FIELD3 char Width 14 Tag: I would like to control Powerpoint by VBS Tag: 200171
Best method to figure out if someone is using cached credentials?
Hello,
I'm attempting to write a script that will figure out if a user is
using cached credentials.
What I figured to do is find the logon server, and see if it is the
hostname of the PC, or not. if so, they aren't authenticating to a DC;
if not, they are using cached credentials.
The only problem is this will affect local users, who are obviously
authenticating to the PC itself as well.
Any way to tell if a user is using cached credentials?
Thanks,
Matt
_____________________________________________
Dim objShell, strRegKey
Dim strLogonServer, strComputerName
Set objShell = CreateObject("Wscript.Shell")
Set objEnvProcess= objShell.Environment("PROCESS")
strLogonServer = Right(objEnvProcess.Item("LogonServer"),
len(objEnvProcess.Item("LogonServer"))) - 2)
strComputerName = objEnvProcess.Item("ComputerName")
if strLogonServer = strComputerName then
msgbox "logonserver is the same"
Else
msgbox "You have logged on locally. You may be using cached
credentials."
End If Tag: I would like to control Powerpoint by VBS Tag: 200169
Excel find row data in every column
Hi,
What I have already is a vbscript that creates and populates an Excel
spreadsheet with multiple columns of data. Now what I require is to
take the data from each row in the each column, and search the other
columns for this data. It then needs to do the same for the second
column, and the third, and so on.
So if I have columns of data, the script will take data from row 1,
column 1 and check to see if that data is in any other cell. It then
needs to tell me which column it is in. Once all the rows from column 1
have been searched for, it then does the same for column 2, column 3,
etc.
Here is what I have so far:
The value y has been set elsewhere and represents the number of
columns.
y = y - 1
i = 4
t = 1
Do Until t = y
'Set range?
Do Until objExcel.Cells(i, t).Value = ""
strName = objExcel.Cells(i, t).Value
Set objSearch = cols.Find(strName)
If objSearch Is Nothing Then
Else
Msgbox y
MsgBox strName & " was found."
End If
i = i + 1
Loop
t = t + 1
Loop
I am having difficulty defining the range to search at the moment. Any
help would be very much appreciated.
Matt Tag: I would like to control Powerpoint by VBS Tag: 200167
Hello
I would like to Math drill test with Powerpoint2000.
And if possible, using Rnd() function to generate the problems.
Is it possible with VBS?
"M.Miura" <mmiura@sysynt.com> wrote in message
news:%23Lx8QgmIHHA.320@TK2MSFTNGP06.phx.gbl...
> Hello
>
> I would like to Math drill test with Powerpoint2000.
> And if possible, using Rnd() function to generate the problems.
> Is it possible with VBS?
>
> M.M.
>
>
>