Adding IP printer with VBScript problem
This is the code I'm using to add my IP printer through a script but
only seems to add the port and not the printer to the machine. Can
anyone tell what would keep the printer from getting added to the
computer?
strComputer = "."
'= strComputer can be an array of netbios computer names or =
'= ip addresses put into a for loop =
Public Error
Dim Count:Count=0
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\cimv2")
Dim IPArray
'= here is where your editing skills happen! =
IPArray = Array( "172.17.20.136")
Dim PrintersArray
'= here is where your editing skills happen again ! =
PrintersArray=Array("c:\hpc2800d.inf")
'= here is where you edit the printer names =
Dim PrinterNames
PrinterNames=Array("HP Color LaserJet 2800 (Remote Office)")
For n = LBound(IPArray) To UBound(IPArray)
'Install the IP printer ports
Install_IP_Ports IPArray(n)
Next
For n = LBound(IPArray) To UBound(IPArray)
Count = Count + 1 'just increments the counter for the message at the
end!
'= Add the printers (Arguments: ip port, path to the .inf files,
printer name) =
'= get the name from the inf files or make one up! =
Add_local_ip_printer IPArray(n), PrintersArray(n), PrinterNames(n)
Next
Make_Default_printer PrinterNames(0)
'= if only one printer in array set to zero e.g. PrinterNames(0) or
comment out!=
'Install the TCP/IP Port(s):
Function Install_IP_Ports(strIPAddress)
Set objNewPort =
objWMIService.Get("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = strIPAddress
objNewPort.Protocol = 1
objNewPort.HostAddress = strIPAddress
objNewPort.PortNumber = "9100"
'objNewPort.Queue = "LPT1_PASSTHRU"
objNewPort.SNMPCommunity = "public"
objNewPort.SNMPEnabled = False
objNewPort.Put_
'stop the spooler
Set colServiceList = objWMIService.ExecQuery _
("Select * from Win32_Service where Name='Spooler'")
For Each objService In colServiceList
errReturn = objService.StopService()
WScript.Sleep 100
Next
'start the spooler
For Each objService In colServiceList
errReturn = objService.StartService()
WScript.Sleep 100
Next
End Function
Function
Add_local_ip_printer(strIP,strPath_To_Inf_Files,strPrintername)
WSHShell.run ("CMD.EXE /C RUNDLL32 PRINTUI.DLL,PrintUIEntry /if /b "_
& chr(34) & strPrinterName & chr(34) &" /f " & chr(34) _
& strPath_To_Inf_Files & chr(34) & " /r " & chr(34) _
& strIP & chr(34) & " /m " & chr(34) & strPrinterName & chr(34) _
& " /q /u"),0,true
End Function
Function Make_Default_printer(strPrinterName)
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer")
For Each objPrinter in colInstalledPrinters
If objPrinter.Name = strPrinterName Then
objPrinter.SetDefaultPrinter()
End If
Next
End Function
Wscript.echo "Script Completed " & count & " Printers Added"
'End Script Tag: Powershell NewsGroup Tag: 209897
EFS, Active Setup and Desktop Folder
I have a requirement to Encrypt the Desktop Folder. Since it is Locked Open
I cannot do so via normal mechanisms. I have written a VB script that I run
during Active Setup to mark the Folder for encryption and to Encrypt its
files and sub-Folders. The script works about 70% of the time. The result
is that the Files under Desktop get encrypted at the time the script runs,
but the Desktop Folder itslef does not have the attribute set. So new Files
added to the Desktop Folder are not encrypted. Is there some sample code out
there to help me on my way? I need to prevent the Desktop Folder from
getting locked, then Mark it for Encryption, then continue on with the user
login process. I thought Active Sertup would do this, but apparently, it
doesn't seem to work every time. I am hoping there is something explicit I
can do in my code to handle this. Thanks for your help. Tag: Powershell NewsGroup Tag: 209894
Regular Expression Help Required
I have downloaded the below code from Microsoft site and modified as per my
requirment. The problem here is the script after matching the first pattern
(837139231DDA)it will write data of that line to an excel file then
immedielty it starts searching for the next pattern without writing the
subsequent line before the next match.
I have another 4 lines between the first match & the second match which is
not getting written to the excel file. Could any one tell me where i am
wrong..
Any help would be great appreciated.
Input file
----------------------------
837139231DDA 3 01 ADD DATE PLACED-- 240807
DATE TO EXPIRE 230809 CIX0044 08/24 13.17 A04NM540
LO SERIAL# HI
SERIAL#
LO AMT HI AMT
CHARGE CODE Y
PAYEE
HUY NGUYEN
SPECIAL COMMENTS
SPECIAL COMMENTS
PH: (07)
837139231DDA 3 01 CHG DATE PLACED-- 240807
DATE TO EXPIRE 230809 CIX0044 08/24 13.17 A04NM540
LO SERIAL# HI
SERIAL#
LO AMT HI AMT
RESTRAINT REASON
DATE NOT PROVIDED
----------------------------
Cod
------------------------------------------------------------------------------------
Const ForReading = 1
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
x = 1
Set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Global = True
objRegEx.Pattern = "^[1-9]........DDA"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Script\Test.txt", ForReading)
'Do while objFile.AtEndOfStream
Do Until objFile.AtEndOfStream
strSearchString = objFile.ReadLine
Set colMatches = objRegEx.Execute(strSearchString)
If colMatches.Count > 0 Then
For Each strMatch in colMatches
objExcel.Cells(x, 1) =strSearchString
x = x + 1
Next
End If
Loop
objFile.Clos
----------------------------------------------------------------------------------- Tag: Powershell NewsGroup Tag: 209890
Accessing the contents of HTA dataarea after update.
I'm trying to access the values of checkboxes that I've passed through
to an HTML page in a script.
A simple example that displays filenames but does not return the
values is:
<html><head>
<title>HTA Test</title>
<HTA:APPLICATION
APPLICATIONNAME="HTA Test"
SCROLL="yes"
SINGLEINSTANCE="yes">
<script language="VBScript">
Set fso = CreateObject("Scripting.FileSystemObject")
Sub GetFiles
onlinepath = "T:\Testing"
topline = "<Table cellpadding=0 cellspacing=0><TR><TD>File Name</
TD><TD align=center width=240>File OK??</TD></TR>"
Set objFolder = fso.GetFolder(onlinepath)
linenum=1
For each objFile in objFolder.Files
fileis = onlinepath & "/" & objFile.name
filelist = filelist & "<TR><TD>" & fileis & "</TD><TD
align=center><input type=""checkbox""" & checked & " name=""TickBox"
& linenum & """></TD></TR>"
Next
filelist = topline & filelist
DataArea.InnerHTML = filelist
End Sub
Sub TestSub
Set TickBox1 = window.event.srcelement
MsgBox TickBox1.Value
End Sub
</script>
</head>
<body onload="GetFiles">
<Form>
<span id = "DataArea"></span>
<input type="button" value=button value="run" name="run_button"
onClick="TestSub"><p>
</TABLE>
</FORM>
</body></html>
How do I access the values of the checkboxes in TestSub?
Regards,
Richard Tag: Powershell NewsGroup Tag: 209885
Path not found error using FSO GetFolder
Hi
I'm using a script to get a list of folders (and subfolders) for a UNC path
but I noticed that if the script tries to get hold of a subfolder path that
is too long to display then it ends with 'Path Not Found' - so the script is
:
Set objFSO = CreateObject("Scripting.FileSystemObject")
objStartFolder = "\\server4\files"
Set objFolder = objFSO.GetFolder(objStartFolder)
Wscript.Echo objFolder.Path
Wscript.Echo
ShowSubfolders objFSO.GetFolder(objStartFolder)
Sub ShowSubFolders(Folder)
For Each Subfolder in Folder.SubFolders
Wscript.Echo Subfolder.Path
Set objFolder = objFSO.GetFolder(Subfolder.Path)
Wscript.Echo
ShowSubFolders Subfolder
Next
End Sub
If I add 'On Error Resume Nex't at the top, then it doesn't display the
error but the script just exits on the problem path again and won't go any
further. I unfortunately don't have the means to change the path structure
and make them smaller or use mapped drive etc. What I effectively need is
the script to ignore any paths that cause a problem and just carry on with
the next.
Is there any other way of getting round this?
Thanks
John Tag: Powershell NewsGroup Tag: 209879
Unlocking locked local accounts
Hi there, hope someone can help me
I know there are other issues, but short-term this is the problem!!
I have a number of users locking accounts by incorrectly passing
credentials to a server. I need to be able to periodically sweep for
these locked accounts and unlock them - these are all local accounts.
I have found a number of ways to identify them, but cannot find a way
to unlock them!
For example
ComputerName = localhost
winmgmt1 = "winmgmts:{impersonationLevel=impersonate}!//"&
ComputerName &""
Set UserSet = GetObject( winmgmt1 ).InstancesOf ("Win32_UserAccount")
for each User in UserSet
if user.lockout = "True" then
---what should go here???
end if
next
Finds me the locked accounts, though seems to add some domain accounts
too....
Code below finds only local accounts and gives me details, but how do
I check and fix locked this way?
strComputer = "bob"
Set colAccounts = GetObject("WinNT://" & strComputer & "")
colAccounts.Filter = Array("user")
For Each objUser In colAccounts
Set objUser = GetObject("WinNT://" & strComputer & "/" &
objuser.name)
Wscript.Echo objUser.Name
Next
If it is easier, I do have powershell on this machine as welll
Regards and thanks
Ross Carr Tag: Powershell NewsGroup Tag: 209876
Avoid loading images - Avoid sounds
Hello,
I'm writing automation scripts in VBA and VBS to use IE6 to retrieve
data from web sites.
I create an instance of IE (or sometimes connect to one instance
already open) and send it commands to navigate to URLs, and retrieve
the data contained in tables etc.
My questions (so far) are:
1) How do I avoid the loading of images? (Ideally the user should be
able to browse normally while my script runs, this means: if the
solutions involves the "display images" option, can it be set to OFF
in one instance without affecting other IE instances?)
2) How to disable the clicking that happens when IE starts navigation?
(again, disabling it in Control Panel shouldn't affect other
instances, ideally)
Thanks in advance
Chris Tag: Powershell NewsGroup Tag: 209865
& and +
hi all
what's the difference between the ampersand and the plus charcters as
cocatenators?
ex
"hello " & "world"
"hello " + "world" Tag: Powershell NewsGroup Tag: 209864
Windows 2000 bsod script to prevent or detect bad hard drive
At work we have several pc's that use windows 2000 professional for vision
systems, and for some reason when we have to shut down our sub-stations
invertently one of our pc's gets the bsod and upon restarting the pc's say
that the system file is corrupt. We have about 100 pc's and it wouldn't be
very possible to physically go around and shut off all the pc's as this
would require too much manpower and it would be less expensive to just
replace the pc and replace the hard drive and ghost the new one for later
use.
Is it possible to write a script to scan the hard drives while the pc still
runs normally so we could first prevent the problem and hopefully mark the
bad sectors as bad as to possibly prolong the life of the drives, and also
to let us know that we need to put it on a schedule to change out the drive.
Also if shutting down the pc's in this manner, (Shutting Power Off) maybe
make a script that would automatically shut down all the pc's.
I have never used vbscript but I've heard that such scripting is possible
using it.
Dave Marden Tag: Powershell NewsGroup Tag: 209840
Trouble with xcacls in usercreation
Hi -
I have made a user-creation script (by taking bits and pieces from
various sources, which works nicely, except for one thing - this code
creates the homefolders nicely, but doesn't apply the right security
settings:
objFSO.CreateFolder "\\SERVER\data$\" & strUserName
strFolder = "\\SERVER\data$\" & strUserName
strXcacls = "Xcacls " & strFolder & " /C /P system:f ""Domain
Admins"":f " & strUserName & ":M /Y"
WshShell.Run strXcacls, 0
It doesn't give any errormessages when run. Can anybody see what I have
missed?
Additionally, I forgot to assign logon-script to some of the groups of
accounts I created - anybody know of a way to assign a logon-script for
accounts that doesn't have one?
Kind regards Tag: Powershell NewsGroup Tag: 209837
Declaring Arrays for use with Split()
I'm very much in the habit of Dim-ing all of my variables and would like be
able to explicitly Dim an array for use with Split(), however its giving me a
'Type Mismatch' error when I try to Dim it.
Dim prefArray(2)
prefArray = split(objFile.ReadLine, chr(9))
The line being read will only, ever have one tab return and thus the line
will only be broken into two values. Tag: Powershell NewsGroup Tag: 209833
Help with RegExp
I need help with the following 3 regular expressions:
1. Using the regexp pattern "^(?:[AUT]\d{5}(?:,|$))+$" the following string
is valid:
A12345,A23456,U45678,U12375,T12345,U87456. How would I have to modify the
pattern to allow for a maximum of 5 values e.g.
A12345,A23456,U45678,U12375,T12345?
2. Which pattern do I have to use to validate the following string, e.g.:
1001,5458,3112
Valid numbers are between 1000 and 9999. Each number needs to be separated
with a comma. The string can only contain a maximum of 10 numbers.
3. Which pattern do I have to use to validate the following string, e.g.:
2007
Valid numbers are between 2000 and 2020. Only 1 number is allowed.
TIA
Pete Tag: Powershell NewsGroup Tag: 209830
VBScript - String - first letters to Uppercase
Hello,
Can anyone please help me with a function that takes a string, a name,
and makes all the first letters Uppercase?
Actually I can already kinda do the above but I'm stuck on initials eg
if I get...
"j.earl jones a.watson" I would like to make that "J.Earl Jones
A.Watson"
and of course if I get just "a.watson" turn that into "A.Watson"
or simply change "james" to "James" and "james watson" to James
Watson.
Basically all the 1st letters unless there is a "." in which case the
first letter also after the "."
It would also be nice to put some kind of a check in case I get
"j.earl." and there is nothing after the "." then leave it.
Thank you in advance :-)
Yas Tag: Powershell NewsGroup Tag: 209829
re: VBScript and Internet Explorer
Could somebody give me a hand with writing a script whereby an Internet
Explorer window can be used to browse a series of pictures, as if browsing
them on a website?
I have the code for creating an IE window, but don't know how to put images
on different pages within that window. It would be great to use the
backwards and forwards arrow buttons to browse these images, if that is
possible.
--
Charles Dean Tag: Powershell NewsGroup Tag: 209823
Mapped disk list
We have a script which executes at users logon which should write to a file
the list of user's mapped disks.
If the user has administrative rights on the client it works , for normal
users it doesn't .
The problem is that it seems that the line
Set colItems = objWMIService.ExecQuery("Select * from
Win32_MappedLogicalDisk")
reports no results
How can we have the script running correctly even with normal users ?
Thanks
Below the portion of the script :
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_MappedLogicalDisk")
For Each objItem in colItems
objOutFile.writeline "Device ID|" & "Percorso di rete|" & "Volume Name|"
& "Description|" & "Free Space|" & "Size"
objOutFile.writeline objItem.DeviceID & "|" & objItem.ProviderName &
"|" & objItem.VolumeName & "|" & objItem.Description & "|" &
objItem.FreeSpace & "|" & bjItem.Size
objOutFile.writeline
Next Tag: Powershell NewsGroup Tag: 209822
Use VBS to set registry values..
Hi,
How do I set the following fields in registry from a vbs script:
1. Auto arrange desktop icons
2. Display the My Computer, Network Neighbourhood, My Documents and IE
shortcuts on the desktop.
Thanks a lot for help on this
regards
jake Tag: Powershell NewsGroup Tag: 209816
ldap security in a script
I have script from the Microsoft site that reads info from AD to create an
OWA distibution list.
The script contains the line Set objGroup = GetObject("LDAP://CN=Finance
Users,OU=Finance,,DC=fabrikam,DC=com")
Authenticated users should have enough access to read this info from AD
shouldn't they?
Thanks, Jeremy Tag: Powershell NewsGroup Tag: 209815
Select Case Limitations
Does VBScript allow expressions such as "1 to 5" and "IS > 89"? The following
code works fine in VBA, however VBScript doesn't appear to 'TO' and 'IS >'
parts fo the case statement.
For i = 1 To Len(strFileName)
Select Case Asc(Mid(strFileName, i, 1))
Case 1 To 39, 42, 43, 44, 46, 47, 58 To 64, 91 To 96, Is > 122
validateFileName = 0
Case Else
End Select
Next i Tag: Powershell NewsGroup Tag: 209804
string match with regular expressions
Hi All,
i'm trying to use regular expressions to filter lines from an input text
file and write to an output
I am looking for lines containing the "Y" character
here is the code part:
...
If myString = "*Y*" Then
OutputFile.WriteLine myString
End if
...
But it looks like this is loking for a match where the star "*"
character is considered as a charcater and not as a wildcard? Tag: Powershell NewsGroup Tag: 209801
change mouse buttons
Hi
I have an injury that means that I can only use my mouse for limited periods
of time. I also use voice activated software - but I often find the need
to move the mouse. I can use the mouse in either hand, but just not for more
than a few minutes on each.
I would like to create a script that would run from an icon on my desktop
that would switch left and right mouse buttons. This way I can simply
activate that script and change hands for the mouse.
I know that the mouse button settings are in the control panel, mouse
settings in XP pro. How can I change these using a script - given I am
using a standard mouse - the basic optical one that comes with a Dell
system.
Any assistance would be appreciated.
Doug Tag: Powershell NewsGroup Tag: 209785
Help with vbscript please - delete files
I know a little about VBscript but am struggling with trying to figure out
how to do the following.
I need to delete all .xml files from a certain directory, however, I need to
delete only certain ones based off of client names.
Can anyone provide me with a script that will do this?
I have 30 clients that generate .xml files in this one directory, yet there
are other .xml files we need to leave alone. All client ID's are based on a
3 character name, for example, AMB, KRT, MLI, TXI, etc
I am trying to write the script to where it will (1) if files exissts then
delete amb*.xml, krt*.xml, etc
If possible, please send a reply to ken@txgeekman.com as well...
Thank you
K_Smith Tag: Powershell NewsGroup Tag: 209780
printer mapping
hi all
i ma trying to find a way to map a network printer via a script, the
printer is not shared by a server, it is reachable via its share name or
its ip address .
all references i found use something like \\servername\sharename to
reach a printer , bu in my case i only have the sharename or the printer ip
tnx Tag: Powershell NewsGroup Tag: 209769
dating agency , japanese dating , meet swedish women , teen dating emotional
http://great-singles-freeweb.com/index547.html
http://great-singles-freeweb.com/index548.html
http://great-singles-freeweb.com/index549.html
http://great-singles-freeweb.com/index552.html
http://great-singles-freeweb.com/index551.html
http://great-singles-freeweb.com/index550.html
http://great-singles-freeweb.com/index652.html
http://great-singles-freeweb.com/index653.html
http://great-singles-freeweb.com/index654.html
http://great-singles-freeweb.com/index655.html
http://great-singles-freeweb.com/index656.html
http://great-singles-freeweb.com/index657.html
http://great-singles-freeweb.com/index658.html
http://great-singles-freeweb.com/index659.html
http://great-singles-freeweb.com/index660.html
http://great-singles-freeweb.com/index661.html
http://great-singles-freeweb.com/index662.html
http://great-singles-freeweb.com/index663.html
http://great-singles-freeweb.com/index664.html
http://great-singles-freeweb.com/index665.html
http://great-singles-freeweb.com/index666.html
http://great-singles-freeweb.com/index667.html
http://great-singles-freeweb.com/index668.html
http://great-singles-freeweb.com/index669.html
http://great-singles-freeweb.com/index670.html
http://great-singles-freeweb.com/index671.html
http://great-singles-freeweb.com/index672.html
http://great-singles-freeweb.com/index673.html
http://great-singles-freeweb.com/index674.html
http://great-singles-freeweb.com/index675.html
http://great-singles-freeweb.com/index676.html
http://great-singles-freeweb.com/index677.html
http://great-singles-freeweb.com/index678.html
http://great-singles-freeweb.com/index679.html
http://great-singles-freeweb.com/index680.html
http://great-singles-freeweb.com/index681.html
http://great-singles-freeweb.com/index682.html
http://great-singles-freeweb.com/index683.html
http://great-singles-freeweb.com/index684.html
http://great-singles-freeweb.com/index685.html
http://great-singles-freeweb.com/index686.html
teenage dating website , top 20 singles , datelines , win a date with
porn , teenage dating age , friend finder , hot sexy date , dating in
ireland , dating tips for teen guys , meet russian woman , singles
online , teen dating sites , porn trailers , sexy women , teen
statistics , women with women , where to meet older women , dating
nl , mature date , tgp porn , new york bar exam dates , american
matchmaking , naked sex , date sex porn , african women seeking men ,
comics porn , dating nu , dating service in new york , best place to
meet women , find dates , sex teens , women with dildos , teen
advise , teen personals , single man , women with strap on , women
with dog , date married women , teen online dating sites , mature
women , single men , online dating agency , photo personals , women
seeking older men , dating , asian women seeking men , date agency ,
porn links , amerikanische single , interracial singles , women having
sex with other women , mature women with big tits , adult dating
personals , couples seeking woman , singles in the usa , women seeking
love , irish dating agencies , dating website for teens , teen dating
advise , single mothers in usa , usa hits , adult sex , speeddating ,
xxx date , singles net , marriage agency scams , dating ireland ,
married woman seeking , american dating services , new york magazine
personals , introduction agencies , usa erotik , porn 08 , romantic
dates in new york , dating ru , older women looking for younger men ,
married women seeking , sex numbers , sexy kitten sim date , christian
teen dating , friendship , teen dating problems , porn pictures , porn
thumbs , ohio dating services , sex date , porn movies , american
singles , mature women seeking younger men , dating girls , nude
porn , new york swingers , mature women with young girls , date porn
games , woman with you , single dating , usa dating singles , women
with small tits , women with eating disorders , adult cams , married
women seeking men , dating dk , uk teen dating , sex chaten , dating
de , porn dating , asian dating , marriage agency odessa , woman with
big boobs , american dateing , dating uk , dating game , dating
brides , teen adult dating , horny married women , top 10 usa
singles , date marathon de new york , sex with pregnant women , teen
dating fun , us dating , conversation with women , kostenlose
singles , aussie matchmaker , amerikan singles , dating for teen ,
matchmaker dating , blinddate porn , billboard top usa singles ,
violence in teen dating , talk dirty , woman with pearl , cupid
dating , american cupids , ohio single , russian dating agencies , sex
logs , usa match , uk singles chart , dating rules , women with
beards , adult sex chats , dating rules for teens , american singles
sites , south american singles , porn video , women with short hair ,
porno date , billboard singles , singles personals , men meet women ,
american sites , teen dating questions , singles women , sex dates ,
teens dating older , great expectations , chinese dating , meet
married women , prom date porn , love dating , usa single chart ,
woman with horse , 8 simple rules for dating my teenage daughters ,
beast dating , now singles , seeking a woman , teen dating and
violence , sex with mature women , dating agency ireland , meet
christian women , teens online dating , singles kontakte , american
speed , new york match maker , catholic dating , women seeking
american men , partnersuche singles , women with big butts ,
matchmaking , cd cover singles , beautiful women , married women sex ,
8 simple rules for dating my teenage daughter episode , up to date
porn , amerika single , women with hairy armpits , dating sex
personals , date of new york , woman having sex with a horse , dating
agency , teenage dating statistics , matchdoctor dating , women
seeking husbands , cleveland personals , clips date , chatsex , old
women with big tits , merced craigslist women seeking men , singles in
new york , meet women online , speed dating new york city ,
matchmaking agency , hiv dating , singles agency , meet beautiful
women , chats prono , miami dating , wedding agency , 8 rules to
dating my teenage daughter , women with facial hair , sex bots ,
christian dating agencies , sex with black women , nude women , teen
dating rules , woman seeking younger man , top 40 usa singles ,
seeking a women , women seeking sex , women with hair , new york
concert dates , american single personals , amerikanische singles ,
dating and new york , flirt with women , matchmaking personals ,
connecting singles , shemale porn , erotic date , speed dating in new
york , latin women seeking men , new york date , usa billboard
singles , sex cam chats , teen dating quizzes , book of matches ,
online dating matchmaking , woman with animal , safe teen dating , sex
dating , asian matchmaking , carbon dating , match personals , dating
service new york , american personals , chats sexi , chatting
females , wedding agencies , meet single girls , teen advice , dating
web sites , woman looking for man , american sex , meet single women ,
guide to teenage dating , in love with a married woman , simple rules
for dating my teenage daughters , married women seeking married men ,
jewish singles , women with huge breasts , sex uk , single usa , cheap
phone sex , new york matchmaker , sim dating games , porn mpg , woman
seeking man for sex , sex lines , porn stories , porn preview , usa
singels , dates in new york , married women for sex , meet sexy
women , ohio personals , older woman seeking younger man , live web
cam , interracial matchmaking , women with dicks , russian dating
agency , speed dating new york , hot married women , marriage agency
romania , women fun , usa greatest hits , easy date porn , women
seeking men in delhi , akron ohio dating , bbw dating , gay speed
dating new york , matchmaking horoscopes , ohio dating laws ,
professional abuse , teen dating forums , american date , hitsville
usa the motown singles collection , meet foreign women , asian date ,
wealthy women seeking men , great expectations dating agency ,
livesex , asian sex , teenage girl dating , tour dates new york , xxx
webcams , eight simple rules for dating my teenage daughter , young
porn , singles amerika , single women in usa , craigslist personals
new york , games with naked women , women sites , mature dating , teen
dating parents , how to meet married women , singles kontaktanzeigen ,
meet muslim women , teen dating guide , women seeking couple , women
with big pussy , sexy ladies , teen dating violence stories , meet
mature women , women with Tag: Powershell NewsGroup Tag: 209767
Get Operating System for all Computers in the Forest.
Can anyone tell me why the "operatingSystem" field doesn't return anything,
but using ADSI Edit there is a value.
Please note there is no errors in the script when run.
Many Thanks,
SRT
Code:
commonNamePart = "*"
Set objRootDSE = GetObject("LDAP://rootDSE")
strRootAdsPath = "GC://" & objRootDSE.Get("rootDomainNamingContext")
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"
Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 500
objCommand.CommandText = "<" & strRootAdsPath &
">;(&(objectCategory=computer)(cn=" & commonNamePart & "))" &
";operatingSystem,name;subtree"
Set objRecordSet = objCommand.Execute
If objRecordSet.EOF Then
WScript.Echo "No Computer found with that name"
Else
WScript.Echo "Computer Name" & vbTab & "OS"
Do Until objRecordset.EOF
Wscript.Echo objRecordset.Fields("name") & vbTab &
objRecordset.Fields("operatingSystem")
objRecordset.MoveNext
Loop
End If
objConnection.Close Tag: Powershell NewsGroup Tag: 209765
vbscript editors
hi all,
what editor would you recommend to write vbscript code (apart form notepad)?
thanks a lot Tag: Powershell NewsGroup Tag: 209750
VBS Script/WMI results different in Windows PE 1.6 vs. Windows PE 2.0
I'm writing a small WMI script to return some information about the
physical disks on a desktop. The script is to be called while Windows
PE is running. Both versions of PE should support WMI, however, I'm
getting different results depending on which version of PE I run the
code under. I'm especially interested in getting the results for the
value of InterfaceType. Under Windows PE 1.6, the value is Null and
under Windows PE 2.0 the value is either IDE or USB (the correct
values). All other values are returned normally. I read that Windows
PE 2.0 does have expanded capabilities on what is available via WMI.
I was just wondering if others had seen similar behavior or if there
was a way to determine if the InterfaceType would ever be available
under PE 1.6?
Here is the script:
***************
Sub ListDiskDriveInfo( strComputer )
Dim objWMIService, colItems
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_DiskDrive",,48)
For Each objItem in colItems
If objItem.InterfaceType <> "USB" then
If objItem.MediaType = "Fixed hard disk media" then
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "DeviceID: " & objItem.DeviceID
Wscript.Echo "Index: " & objItem.Index
GIndex = objItem.Index + 1
Wscript.Echo "Ghost Index: " & GIndex
Wscript.Echo "InterfaceType: " & objItem.InterfaceType
Wscript.Echo "MediaType: " & objItem.MediaType
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Partitions: " & objItem.Partitions
Wscript.Echo "Size: " & objItem.Size
Wscript.Echo "Status: " & objItem.Status
Wscript.Echo "SystemName: " & objItem.SystemName
Wscript.Echo "********************* "
End If
End If
Next
End Sub
'
****************************************************************************
' Main
'
****************************************************************************
Dim strComputer
'* Do
'* strComputer = inputbox( "Please enter a computername or . for local
computer", "Input" )
'* Loop until strComputer <> ""
strComputer = "."
ListDiskDriveInfo( strComputer )
************** Tag: Powershell NewsGroup Tag: 209746
regex backreferance question
I thought I was creating backreferances in this string
" System Serial Number: 1036358 (oldwlrfsr200" with RegEx.Pattern = "(System
Serial Number):(.*)\s(\(.*\))"
I expected three MATCH items but the match was the whole string. I thought
this would have created three matches, what happened? If I can create three
matches from this string, how can I referance a match directly? Tag: Powershell NewsGroup Tag: 209737
Improving my script
I have this test script:
Option Explicit
Dim sComputer, oWMIService, xServices, item
sComputer = "."
Set oWMIService = GetObject("winmgmts:\\" & sComputer & "\root\cimv2")
Set xServices = oWMIService.ExecQuery("Select * from Win32_Service Where
Caption='Alerter' AND State='Stopped'")
For Each item In xServices
If item.Caption = "Alerter" Then
WScript.Echo "Doing some action because Alerter is stopped."
End If
Next
Is there a way to determine if xServices is empty or not without using a For
Each loop? For instance, if the Alerter service is started, the example
script above should not have any items in the xServices collection. (btw, is
xServices a collection or an object?)
Thanks,
Gill Tag: Powershell NewsGroup Tag: 209736
launching QuickTime
I've been trying to figure out how to do this for a couple of days and
I'm stumped. I'm trying to open up a QuickTime file and extract all
the metadata from it (duration, size, etc.) I know this is possible,
but I haven't seen anything in my searching about HOW to do it.
Any help would be greatly appreciated.
Brian Tag: Powershell NewsGroup Tag: 209730
Using and Array in an HTA
I've taken one of my vbscripts that pre-creates computer accounts in the
proper OU and threw it into an HTA. The script works quite well, but I'd
like to make the domain selection drop down more dynamic. I've managed to
get a list of the root domain and all it's child domains, but I need to
filter out some duplicates before it goes into the drop down.
What I've done is put all the data into an array and used the following code
to filter out duplicates:
Do Until objRecordSet.EOF
strdnsRoot = join(objRecordSet.Fields("dnsRoot").Value)
If objDictionary.Exists(strdnsRoot) Then
objDictionary.Add strdnsRoot, strdnsRoot
End If
objRecordSet.MoveNext
Loop
The code works as it's suppose to, but when I try and dump it into the
dropdown, nothing happens.
For Each strKeys in objDictionary.Keys
ServerSuccess.innerHTML = strKeys
Next
If I dump this in a standard vbscript and use wscript.echo to output the
data it works properly. Am I missing something? Thanks. Tag: Powershell NewsGroup Tag: 209729
CopyHere keeps asking for overwrite confirmation
Hello,
I have a problem already addressed unsuccessfully in this newsgroup,
but I'll try anyway.
The following script (derived from another script published in this
group) is supposed to extract a ZIP file to a temp folder and run a
predefined installer, but the CopyHere method seems to ignore the
FOF_NOCONFIRMATION and/or FOF_NOCONFIRMDIRCREATE options (in the last
part of the script), as the file overwrite confirmation dialog keeps
appearing.
Could it be that CopyHere is fooled by the use of the Items method to
enumerate the contents of the zip file?
I'm looking for alternative solutions, but I cannot make use of any
plugin, like a Winzip command line utility.
Thank you,
/_urka
Option Explicit
Dim WshShell, FS, SA, TempFolder, FilesInZip, PathToZipFile
Const ZipFile = "\zipfile.zip"
Const FileToRun = "installer.vbe"
Const Params = "/S /L"
Const Dest = "\whatever"
Const FOF_NOCONFIRMATION = 16
Const FOF_NOCONFIRMDIRCREATE = 512
'===================================================================
'Retrieves the current directory to create the full path to zip file
'===================================================================
Set WshShell = CreateObject("WScript.Shell")
PathToZipFile = WshShell.CurrentDirectory & ZipFile
WScript.Echo "The zip file is in " & PathToZipFile & VBCRLF _
& "Click OK to proceed with the installation"
'==================================================
'Creates a folder to extract the zip contents into
'==================================================
Set FS = CreateObject("Scripting.FileSystemObject")
TempFolder = FS.GetSpecialFolder(2) & Dest
If FS.FolderExists(TempFolder) = False Then
FS.CreateFolder(FS.GetSpecialFolder(2) & Dest)
End If
'==========================================================================
'Extracts the zip contents into TempFolder overwriting without
confirmation
'and launches the installer with the assigned parameters
'==========================================================================
Set SA = CreateObject("Shell.Application")
Set FilesInZip = SA.NameSpace(PathToZipFile).Items
SA.NameSpace(TempFolder).CopyHere FilesInZip, FOF_NOCONFIRMATION +
FOF_NOCONFIRMDIRCREATE
SA.ShellExecute FileToRun, Params, TempFolder Tag: Powershell NewsGroup Tag: 209724
WSH 5.6 downloads are back...
WSH 5.6 downloads are back...
Windows Script 5.6 for Windows XP and Windows 2000 / Windows Server 2003
Download details: Windows Script 5.6 for Windows XP and Windows 2000
<http://www.microsoft.com/downloads/details.aspx?familyid=c717d943-7e4b-4622-86eb-95a22b832caa&displaylang=en&tm>
Download details: Windows Script 5.6 for Windows Server 2003
<http://www.microsoft.com/downloads/details.aspx?familyid=887fce82-e3f5-4289-a5e3-6cbb818623aa&displaylang=en&tm>
--
Michael Harris
MVP - Windows Server Admin Frameworks Tag: Powershell NewsGroup Tag: 209706
re: the 'switch to' message
I am using VBScript to allow a program to pass data to Excel. Once the data
is passed, the program re-opens the workbook which it has passed the data to
in order to analyse.
At certain stages during the running of the script, the following 'Server
Busy' message appears:
"This action cannot be performed because the other program is busy. Choose
'switch to' to activate the program and correct the program."
I have been advised to use the 'objExcel.DisplayAlerts = False' instruction
but this appears not to be working.
Why is this happening and is there a way to avoid it? It happens at some
points at certain occasions, and at other points every time the program is
run.
--
Charles Dean Tag: Powershell NewsGroup Tag: 209704
Set the monitor to be always on
How can I set a user's Power settings in particular making it so the
Monitor is always on. I have tried using PowerCFG but that doesn't
seem to work (IE it works on some workstations and not on others. I
want to do this for a specific roaming user profile.
Thanks Tag: Powershell NewsGroup Tag: 209703
Make folder with accompanying shortcut if possible
Hi,
In a vbs domain logon script I need to have a folder
"C:\Transfer\"+%username% on the user's workstation created. If it
already exists, the statement should throw no error message.
Furthermore I would like to create a shortcut named 'My Transfers' on
the user's desktop pointing to this newly created folder.
("C:\Transfer\"+%username%)
How would I code this using vbs?
Thanks a lot if someone has a minute ;-)
regards
jake Tag: Powershell NewsGroup Tag: 209701
output to a window that allows output text copy from
hi all
is there a way to send the output from a vbscrpt to a window or message
box were i can copy/cut the output text from ? or is the only option
writing output to a file?
thanks Tag: Powershell NewsGroup Tag: 209698
VB to remotely set default printer
Any ideas why I can't for the life of me get any code samples of any code
whether VB or dos commands using rundll32, to remotely set a default printer
on a Windows XP computer. I am using the code below:
strComputer = "remotecomputername"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer Where Name = 'PrinterName'")
For Each objPrinter in colInstalledPrinters
objPrinter.SetDefaultPrinter()
Next
but it simply executes silently and does NOT set the default printer on the
remote machine. The values are not updated in this sample to show actual
computer or printer names. All the samples I find on this function execute,
but do not perform the required action on the remote PC. They work perfectly
fine locally.
So I guess my question is this even a supported function of VB and WMI to
remotely set a default printer? Is this a limitation or by design issue
where you just can't do that? And if so, does anyone have any suggestions on
how to accomplish this. I am trying to script the deletion of local printers
from Windows XP machines, the installation of new printer server based
printer shares on Server 2003, and the selecting of a default printer. I
have everything else working, but can't for the life of me get anything I try
to remotely set a default printer.
any help is greatly appreciated.
Thanks Tag: Powershell NewsGroup Tag: 209695
File and folder auditing
Hey Guys,
I need to write a script that configures auditing of object access for the
Everyone group:
List Folder / Read Data
Create Files / Write Data
Delete
Change Permissions
Take Ownership
for these files and folders
Files
%SYSTEMROOT%\SYSTEM32\CMD.EXE
%SYSTEMROOT%\SYSTEM32\COMMAND.COM
%SYSTEMROOT%\SYSTEM32\CSCRIPT.EXE
Folders
%SYSTEMROOT%
%SYSTEMROOT%\CONFIG
%SYSTEMROOT%\SYSTEM32
Anyone have any ideas? Tag: Powershell NewsGroup Tag: 209691
Permission Denied Errors - FileSystemObject
I'm using the FSO object to manage the contents of a list box on a Custom
Outlook Form. On occasion, I've gotten the 'Permission Denied' error when
trying to save the contents or otherwise work with the text (*.txt) file
involved as in copy and delete.
Any ideas as to why?
More importantly have any of you encountered the error as well?
Exiting Outlook and restarting corrects the problem. Tag: Powershell NewsGroup Tag: 209690
Copy multiple files with a recordset
Ok, I know how to pull information from a database with a record set, but I
was wondering if you could actually copy multiple files with it.
I'm trying to go through a series of folders that search for a reference
number, but the file ext can be different and the file isn't always jut the
ref number.
examples:
12345.zip
12345.ba1
12345.bad
12345pan.zip
etc.
folders include
prod
proto
hold
I have a script that will go through and find just the .zip files... I'll
post it incase anyone sees a easier fix.
This script is still in it's infant stages so I haven't gone through and
added everything it needs to do.
Thanks
On Error Resume Next
Set objExplorer = WScript.CreateObject _
("InternetExplorer.Application", "IE_")
Set objShell=CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim strZippedFile ' The full path/filename of the file to unzip
strCommandLine = "pspecs " & strONum
strView = "c:\view\"
objExplorer.Navigate "file:///C:\Scripts\dropdown.htm"
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 250
objExplorer.Height = 175
objExplorer.Visible = 1
Do While (objExplorer.Document.Body.All.OKClicked.Value = "")
Wscript.Sleep 250
Loop
strType = objExplorer.Document.Body.All.OKClicked.Value
strONum = objExplorer.Document.Body.All.fldOrderNum.Value
objExplorer.Quit
Wscript.Sleep 250
If strType = "Cancelled" Then
Wscript.Quit
End If
If strONum = NULL Then
wscript.echo "Order number required"
Wscript.Quit
End If
' =====================================================================
' Locates file and copies it over
' =====================================================================
objShell.Run strCommandLine, 1, true
if strType = "Production" then
Dim strCopy, StrK, StrO, strcamb, strHold, strProd
strCopy = "c:\view\" & strONum & ".zip"
strK = "k:\prod\" & strONum & ".zip"
strO = "o:\prod\" & strONum & ".zip"
strcamb = "s:\cambak\prod\" & strONum & ".zip"
strHold = "k:\hold\prod\" & strONum & ".zip"
strProd = "o:\prod\" & intProd(strONum) & "\" & strONum & ".zip"
wscript.echo strProd
if objFSO.FileExists(strK) Then
wscript.echo "Found in the K"
objFSO.CopyFile strK, strCopy, true
elseif objFSO.FileExists(strO) then
wscript.echo "Found in the O"
objFSO.CopyFile strO, strCopy, true
elseif objFSO.FileExists(strcamb) then
wscript.echo "Found in the CAMBAK"
objFSO.CopyFile strcamb, strCopy, true
elseif objFSO.FileExists(strHold) then
wscript.echo "Found in the Hold"
objFSO.CopyFile strHold, strCopy, true
elseif objFSO.FileExists(strProd) then
wscript.echo "Found in the " & intProd(strONum)
objFSO.CopyFile strProd, strCopy, true
else
wscript.echo "File not found"
End if
else
strCopy = strview & "P" & strONum & ".rel"
strproto = "S:\MODEM\REL\P" & strONum & ".rel"
objFSO.CopyFile strProto, strCopy, true
wscript.echo "File Copied"
end if
strComLine2 = "c:\scripts\wzunzip c:\view\" & strONum & ".* c:\view"
objShell.Run strComLine2, 1, true
' =====================================================================
' End
' =====================================================================
Function intProd(ByVal intChar)
Select Case TRUE
Case intChar > 0 and intChar <= 5000
intProd = "01k-5k"
Case intChar > 5001 and intChar <= 10000
intProd = "05k-10k"
Case intChar > 10001 and intChar <= 15000
intProd = "10k-15k"
Case intChar > 15001 and intChar <= 20000
intProd = "15k-20k"
Case intChar > 20001 and intChar <= 25000
intProd = "20K-25k"
Case intChar > 25001 and intChar <= 30000
intProd = "25k-30k"
Case intChar > 30001 and intChar <= 35000
intProd = "30k-35k"
Case intChar > 35001 and intChar <= 40000
intProd = "35k-40k"
Case intChar > 40001 and intChar <= 45000
intProd = "40k-45k"
Case intChar > 45001 and intChar <= 50000
intProd = "45k-50k"
Case intChar > 50001 and intChar <= 55000
intProd = "50k-55k"
Case intChar > 55001 and intChar <= 60000
intProd = "55k-60k"
Case intChar > 60001 and intChar <= 65000
intProd = "60k-65k"
Case intChar > 65001 and intChar <= 70000
intProd = "65k-70k"
Case intChar > 70001 and intChar <= 75000
intProd = "70k-75k"
Case intChar > 75001 and intChar <= 80000
intProd = "75k-80k"
Case intChar > 80001 and intChar <= 85000
intProd = "80k-85k"
Case intChar > 85001 and intChar <= 90000
intProd = "85k-90k"
Case intChar > 90001 and intChar <= 95000
intProd = "90k-95k"
Case intChar > 95001 and intChar <= 100000
intProd = "95k-100k"
Case Else
intProd = "100K"
End Select
End Function Tag: Powershell NewsGroup Tag: 209688
REPOST INFO ONLY: Running a VBS elevated under Vista with UAC enabled
Hi,
this is an old message I posted in microsoft.public.scripting.wsh on March
2nd, 2007. I repost here because some people asked me about this problem.
Hope you'll find it useful.
By the way, now there's also a different solution from MS guys:
http://www.microsoft.com/technet/technetmag/issues/2007/06/UtilitySpotlight/default.aspx
Massimo.
------ ORIGINAL POST FOLLOWS --------
Hi.
I think that your problem is due to the fact that you need elevated
privilege to execute certain tasks. This is quite easy if you develop a
program in Visual Studio .NET. In this way you can add a manifest to you
project is order to have it running with elevated privileges (user just been
asked to confirm elevation of privileges). Unfortunately Microsoft says this
is theoretically impossible for VBS. Fortunately this is not completely
true. I spent several days fighting with UAC, and it's a pleasure to share
my findings with others. I was able to run VBS in elevated privilege mode
with a couple of tricks:
1) If you right click an EXE file, you see "Run as Administrator", if you
right click a VBS file not. SOLUTION: create a file named VBS.REG and copy
the following on it:
------- copy below -------
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\VBSFile\Shell\runas]
[HKEY_CLASSES_ROOT\VBSFile\Shell\runas\command]
@="C:\\Windows\\system32\\WScript.exe \"%1\" %*"
"IsolatedCommand"="C:\\Windows\\system32\\WScript.exe \"%1\" %*"
------- copy end -------
Double click VBS.REG and apply to registry. Now you have "Run as
Administrator" right clicking a VBS.
2) To avoid user having to right click the VBS each time, you can run it as
administrator from an other VBS (that don't need to run as administrator).
If you need to run C:\MYVBS.VBS as administrator, create a script RUNME.VBS
like this:
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\")
Set objFolderItem = objFolder.ParseName("MYVBS.VBS")
objFolderItem.InvokeVerb "runas"
Now just doubleclick RUNME.VBS. It'll ask user to confirm elevation of
privileges, and then run C:\MYVBS.VBS elevated.
Massimo. Tag: Powershell NewsGroup Tag: 209682
how to call a web service without using soap toolkit
Reading from Microsoft they say that the soap toolkit is no longer
supported, and on top of that it seems to be very touchy and hard to
troubleshoot.
I want to find a new way of consuming a asp.net web service from vbs script.
does any one know how to call a web service from vbs or call a .net dll from
vbs Tag: Powershell NewsGroup Tag: 209680
code for silent installing software using VBscript
Hi,
I need to create script to install ( .netframework2.0,MDAC2.7,XML4.0,
VC++2005,Windows installer services3.0,OWC10.0)with silent installation
through VBscript.
the script should be able to check the previous registry entry,which
machine do not have the particular version, then installation will start
from my script with software folder.The executable script and softwares will
be located on same folder.
i have developed script.but problem is not able to find silent installation
via vbscript.i have command line switches and it is working fine using cmd
prompt.(standalone machine).But using script does not support the same
command line.
i will send my script and command line details.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.Shell")
Set objNetWork = WScript.CreateObject("WScript.Network")
strComputer = "."
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\"&
strComputer & "\root\default:StdRegProv")
Computername= objNetWork.computername
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
blnVcplus = false
blnOWC = false
blnDotnet = false
'blnXml = false
For Each subkey In arrSubKeys
Select case subKey
'For VC++
case "{A49F249F-0C91-497F-86DF-B2585E8E76B7}"
blnVcplus = true
'For OWC
case "{90260409-6000-11D3-8CFE-0050048383C9}"
blnOWC = true
'For Dotnet
case "{7131646D-CD3C-40F4-97B9-CD9E4E6262EF}"
blnDotnet = true
'For Xml
'case "{716E0306-8318-4364-8B8F-0CC4E9376BAC}"
'blnXml = true
end select
next
If blnVcplus = false Then
RunInstaller("""C:\Documents and Settings\134520\Desktop\working\vc++""")
End If
If blnOwc = false Then
RunInstaller("""C:\Documents and Settings\134520\Desktop\working\owc10.
exe""")
End If
If blnDotnet = false Then
RunInstaller("""C:\Documents and Settings\134520\Desktop\working\dotnet""")
End If
'If blnDotXML = false Then
'RunInstaller("""C:\Documents and Settings\134520\Desktop\working\XML""")
'End If
set arrSubKeys=nothing
Function RunInstaller(installerPath)
Dim fso, sh, r, s, pe,wshshell
Set fso = CreateObject("Scripting.FileSystemObject")
Set wshShell = WScript.CreateObject ("WSCript.shell")
wshshell.run """C:\Documents and
Settings\134520\Desktop\working\WindowsInstaller.exe""", 6, false
wshshell.run installerPath, 6, false
set wshshell = nothing
End Function
Command line switches for my pre-requisites.
.net2.0 -
dotnetfx.exe /q:a /c:"Install /q"
vc++
"VCREDI~1.EXE" /q:a /c:"msiexec /i vcredist.msi /qb!"
OWC10
owc10.exe /q:a /c:"msiexec /i owc10se.msi /qb!"
xml4.0
msiexec /i msxml4.msi /qn
kindly please provide your solution.
thanks,
N.senthil Tag: Powershell NewsGroup Tag: 209679
code for silent installing software using VBscript
Hi,
I need to create script to install ( .netframework2.0,MDAC2.7,XML4.0,
VC++2005,Windows installer services3.0,OWC10.0)with silent installation
through VBscript.
the script should be able to check the previous registry entry,which
machine do not have the particular version, then installation will start
from my script with software folder.The executable script and softwares will
be located on same folder.
i have developed script.but problem is not able to find silent installation
via vbscript.i have command line switches and it is working fine using cmd
prompt.(standalone machine).But using script does not support the same
command line.
i will send my script and command line details.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.Shell")
Set objNetWork = WScript.CreateObject("WScript.Network")
strComputer = "."
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\"&
strComputer & "\root\default:StdRegProv")
Computername= objNetWork.computername
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
blnVcplus = false
blnOWC = false
blnDotnet = false
'blnXml = false
For Each subkey In arrSubKeys
Select case subKey
'For VC++
case "{A49F249F-0C91-497F-86DF-B2585E8E76B7}"
blnVcplus = true
'For OWC
case "{90260409-6000-11D3-8CFE-0050048383C9}"
blnOWC = true
'For Dotnet
case "{7131646D-CD3C-40F4-97B9-CD9E4E6262EF}"
blnDotnet = true
'For Xml
'case "{716E0306-8318-4364-8B8F-0CC4E9376BAC}"
'blnXml = true
end select
next
If blnVcplus = false Then
RunInstaller("""C:\Documents and Settings\134520\Desktop\working\vc++""")
End If
If blnOwc = false Then
RunInstaller("""C:\Documents and Settings\134520\Desktop\working\owc10.
exe""")
End If
If blnDotnet = false Then
RunInstaller("""C:\Documents and Settings\134520\Desktop\working\dotnet""")
End If
'If blnDotXML = false Then
'RunInstaller("""C:\Documents and Settings\134520\Desktop\working\XML""")
'End If
set arrSubKeys=nothing
Function RunInstaller(installerPath)
Dim fso, sh, r, s, pe,wshshell
Set fso = CreateObject("Scripting.FileSystemObject")
Set wshShell = WScript.CreateObject ("WSCript.shell")
wshshell.run """C:\Documents and
Settings\134520\Desktop\working\WindowsInstaller.exe""", 6, false
wshshell.run installerPath, 6, false
set wshshell = nothing
End Function
Command line switches for my pre-requisites.
.net2.0 -
dotnetfx.exe /q:a /c:"Install /q"
vc++
"VCREDI~1.EXE" /q:a /c:"msiexec /i vcredist.msi /qb!"
OWC10
owc10.exe /q:a /c:"msiexec /i owc10se.msi /qb!"
xml4.0
msiexec /i msxml4.msi /qn
kindly please provide your solution.
thanks,
N.senthil Tag: Powershell NewsGroup Tag: 209678
NET SEND
Hi,
Does anyone know of a simple VB Script for using Net Send on a Windows XP
network. I would like to be able to Net Send either a UserName, IPAddress
or ComputerName via an Input Box. The message to send would always be the
same "Please ring Gazza on ......... in regards your Computer problem"
Regards,
Gazza Tag: Powershell NewsGroup Tag: 209675
Failing to connec tto run script NTLMLogin resulted in hr = 0x8004
Please help :(
I have no problem running the script from the local machine, but when I try
to run it on a remote computer I get a listing of the eventlog types and
nothign else. A look trhough the wmi logs found this error;
NTLMLogin resulted in hr = 0x8004100e
****************
Set objWMIService = GetObject("winmgmts:\\" & REMOTE_SERVER & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery _
("Select * from Win32_NTEventLogFile where LogFileName='Security'")
For Each objLogfile in colLogFiles
errBackupLog = objLogFile.BackupEventLog("c:\scripts\Security.evt")
If errBackupLog <> 0 Then
Wscript.Echo "The Security event log could not be backed up."
Else
objLogFile.ClearEventLog()
End If
Next Tag: Powershell NewsGroup Tag: 209667
Script retuning error on remote machine
I have the following script. I works fine for the local machine, but when I
try to run it on a remote system, it is failing with;
NTLMLogin resulted in hr = 0x8004100e
I am completely lost, please help :(
strComputer = "REMOTE_COMPUTER"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Backup)}!\\" & _
strComputer & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery _
("Select * from Win32_NTEventLogFile where LogFileName='Application'")
For Each objLogfile in colLogFiles
errBackupLog = objLogFile.BackupEventLog("c:\scripts\application.evt")
If errBackupLog <> 0 Then
Wscript.Echo "The Application event log could not be backed up."
Else
objLogFile.ClearEventLog()
End If
Next Tag: Powershell NewsGroup Tag: 209662
Is it possible to have my CD-Rom load via a script. (Close the CD Tray)
I have the following script, that is awesome thanks to this group:
****************************************************************************
Const FOF_CREATEPROGRESSDLG = &H0&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.NameSpace("I:\")
objFolder.CopyHere "K:\*.*", FOF_CREATEPROGRESSDLG
CreateObject("Shell.Application").Namespace(17).ParseName("K:
\").InvokeVerb("E&ject")
****************************************************************************
The only thing I would like it to do in addition is to load the CD I
place in the tray, so I don't have to push the tray or button on the
CD drive itself, is this possible via a script? Any ideas. Tag: Powershell NewsGroup Tag: 209629
Vista "Junction Point" Issue
Hey Scripting Guys !
I have an issue with a script I made for calculating â??documentsâ?? folder size.
Itâ??s OK on XP but on all VISTA systems itâ??s not working. I get a â??permission
deniedâ??
Here is my (simple) script.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set MyDspace = objFSO.GetFolder("C:\Users\My_Name\Documents")
IntSpace1 = MyDspace.Size
Wscript.echo IntSpace1
I get a â??permission deniedâ?? error when I launch it.
I know why but I donâ??t how to solve itâ?¦
The error is related to â??My Picturesâ??, â??My Musicâ?? and â??My Videosâ?? junction
points located in the â??Documentsâ?? folder.
How can my script calculate â??documentsâ?? folder size skipping those 3
junction points ?
Thanks for your reply ! Tag: Powershell NewsGroup Tag: 209624