User's SID
Does anyone have script or know of a utility that will match the username
with the SID or visa versa.
Many Thanks Tag: Remote Assistance Tag: 191341
Function To Detroy Adapter Connection
Hi people,
Anyone knows how to create a Sub to update network card??
For example my script check connection if True restarts my service, is
not update network card, but I can=B4t use my Sub UpdateAdapter anyone
can show me wrong???
If boolWireless =3D True Then
Set colServiceList =3D objWMIService.ExecQuery ("Select * from
Win32_Service where Name=3D'SWFTPClient'")
For Each objService In colServiceList
teste =3D objService.ChangeStartMode("Automatic")
objService.StartService()
WScript.Echo "Iniciado"
Next
Else
boolWireless =3D False
UpdateAdapter objItem.NetConnectionID, True
End If
Sub UpdateAdapter(targetConnection, enable)
Set sa =3D CreateObject("Shell.Application")
Set NetConn =3D sa.Namespace(49)
Set Connections =3D NetConn.Items
For i =3D 0 To Connections.Count - 1
If Connections.Item(i).Name =3D targetConnection Then
Set cnx =3D Connections.Item(i)
If (enable and cnx.Verbs.Item(0).Name =3D "En&able") or (not enable
and cnx.Verbs.Item(0).Name =3D "Disa&ble") then cnx.Verbs.Item(0).DoIt()
WScript.Sleep 10000
End If
Next
End Sub
So Shinbaum give me tip, but I need help to can do this!!!
(Crash,
You will need to destroy the connection and create a new one to get the
updated status.
I would suggest that you make a function that returns the status.
Inside the
fucntion is where you open the connection to get the status, then at
the end
of the function close the connection. That way each time you call the
function you will get the current status.=20
Shinbaum) Tag: Remote Assistance Tag: 191334
Getting Source of a HML-File
Hallo,
this is my fist post here, so please apologize if its the wrong group or
topic....
I'm trying to get the source of a HMTL-FIle to read it line by line.
I found a little example that I customized to my requirements, please
find class-definition and program below.
My problem is the routine "title".
As you see it is possible to access the titel of the page
with "objDocument.title" (type is MSHTML.HTMLDocument), and it is
displayed properly.
If I access "body" I get an object, but don't know how to handle.
How do I get the source-code of the page?
I'd like to read the lines into a string-array.
Any suggestions?
Grüße
Werner
------ prog -----------------------
Sub main()
Dim objIEController As clsIEControll
Dim url As String
url = "http://www.Kinderbahn.de"
Set objIEController = New clsIEControll
With objIEController
.LoadDocument url
Do While Not .DocumentComplete
DoEvents
Loop
.title
End With
End Sub
------ class defintion -------------
Option Explicit
Dim WithEvents objIE As InternetExplorer
Dim mDocumentComplete As Boolean
Public Property Get DocumentComplete() As Boolean
DocumentComplete = mDocumentComplete
End Property
Public Sub LoadDocument(strDocumentname As String)
mDocumentComplete = False
objIE.Navigate2 strDocumentname
End Sub
Private Sub Class_Initialize()
Set objIE = New InternetExplorer
objIE.Visible = True
objIE.Silent = True
End Sub
Private Sub Class_Terminate()
Set objIE = Nothing
End Sub
Private Sub objIE_BeforeNavigate2(ByVal pDisp As Object, url As Variant,
Flags As Variant, TargetFrameName As Variant, PostData As Variant,
Headers As Variant, Cancel As Boolean)
mDocumentComplete = False
End Sub
Private Sub objIE_DocumentComplete(ByVal pDisp As Object, url As Variant)
mDocumentComplete = True
End Sub
Public Sub title()
Dim objDocument As MSHTML.HTMLDocument
Set objDocument = objIE.document
MsgBox objDocument.title
Set objDocument = Nothing
End Sub
--
MODELLEISENBAHN FÜR KINDER ==> http://www.kinderbahn.de
THEMA SCHMALSPURBAHN ==> http://www.thema-schmalspurbahn.de
mailto:wf.usenet.nospam.35@werner-falkenbach.de (das kommt schon an) Tag: Remote Assistance Tag: 191333
Search & Replace
Hello together,
when I copy our ~1000 Intranet Websites from Live Intranet to my Test VMWare
Intranet I must change the emails in the Website Codes everytime I do the
"place-change". So for example I must search & replace "me@sales.com" to
"xxx@sales.com" everytime I copy the files back to the Live Intranet Folder
and this for all 1000 Files. Have to do this with 2 different Mail
adresses.... For sure, many Editors allow it to read in whole directories
and search and replace there but .... Maybe there is a way to write a script
which does the search & replace thing automatically by just double clicking?
Does anyone know a solution for my problem? Would be very nice!
Thanks in advance.
Timm Herget Tag: Remote Assistance Tag: 191332
Copy a recordset (multiple rows) into an array
I've found two ways of doing this, but neither one is exactly what i
need. I want to be able to refer to the fields by name, but also be
able to store more then one record.
Option 1. dictionary opject. - It seems this would be vbscripts what of
doing an associative array. I could get a value from a row like this.
' i havn't tried it, but it seemed pretty straightforward.
strMyName = objDict.Item("Name")
But what if i had more then one row?
Option 2 - This solves the problem with the dictionary object, but now
i can't specify the name of the field. I have to know what position it
is in.
arrRecordArray = rsA.GetRows
' assuming my "Name" is in the second row, and in the second colomn.
strMyName = arrRecordArray(1,1)
Is there any way to store the recordset so that i can access it by
record number and fieldname?
ie: strMyName = aryRecords(intRecNum)("Name") Tag: Remote Assistance Tag: 191327
opening file using window.open
In my asp.net application I have vbscript to open a local file.
Example:
window.open(file:\\C:\Rpt.doc)
This use to work fine for all operation systems and browsers but now it
doesn't. It still working on W2K machine but is not working on XP(sp2)
with IE(6.0.29sp2).
I tried to change from window.open to this but then some users are
getting script error when they closed the open file:
Dim objIEA
Set objIEA = CreateObject("InternetExplorer.Application")
objIEA.Visible = True
objIEA.Navigate urlName
While objIEA.Busy
Wend
Set objIEA = Nothing
Is anyone else having this problem? Is there another way to open a file
from the browser?
Any help would be great appreciated!!!
Thanks,
Deidre Tag: Remote Assistance Tag: 191324
Check for running application?
How can I check if an application is running in a VBScript?
In this case, I'm trying to see if Internet Explorer is open.
Thanks,
Russ Tag: Remote Assistance Tag: 191323
SchTasks help
OK, I am trying to use SCHTASKS in a vbScript. However, I need to use spaces
in my path to launch the app, since JohnDo~1 may refer to "John Doe" or "John
Doeboy", depending which was installed first. How would I setup this line?
The /norun below would signify command-line arguments. The double-quote
thing never works and I tried triple-quotes but that didn't run either.
*********************************************
LaunchCommand = "SchTasks /create /tn ""Comment"" /tr ""C:\Program
Files\App.Exe /norun"" /sc once /st " & NewTime & " /sd " & NewDate & " /ru "
& InstallAccount & " /rp " & InstallPassword
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec(LaunchCommand)
*********************************************
Any help would be appreciated.
THANKS! Tag: Remote Assistance Tag: 191322
Retrieving data from StoredProcedure passing a parameter in VBScript
I am trying to get data from the storedprocedure passing a parameter
and the code is clean if i comment the line that retreives the data.
The only task remains is how do I get the data from the recordset
because the stored procedure was executed properly. Basically the line
where --Wscript.Echo oRS.Fields("Column").Value-- needs to be replace
with some correct code that retrieves the data and echo's it.
-----------------------------------------------------------
Const adInteger = 3
Const adVarChar = 200
Const adParamInput = 1
Const adParamReturnValue = 4
Const adCmdStoredProc = 4
Dim param
Dim sServer, sDatabase, sConnection , strVal
sServer = "."
sDatabase = "DB"
sConnection = "Provider=SQLOLEDB;Data Source=" & sServer & ";Initial
Catalog=" & sDatabase & ";Integrated Security=SSPI;"
Dim oConn, oCmd
Set oConn = CreateObject("ADODB.Connection")
Set param = CreateObject("ADODB.Parameter")
Set oCmd = CreateObject("ADODB.Command")
oConn.Open sConnection
oCmd.ActiveConnection = oConn
oCmd.CommandText = "SP"
oCmd.CommandType = adCmdStoredProc
Set param = oCmd.CreateParameter("@mail",adVarChar,adParamInput,100)
oCmd.Parameters.Append param
oCmd.Parameters.Refresh
param.Value = "S@S.COM"
Dim oRS
Set oRS = CreateObject("ADODB.Recordset")
Set oRS = oCmd.Execute
--Error on this below line
Wscript.Echo oRS.Fields("Column").Value
--Error description
--Item cannot be found in the collection corresponding to the requested
name or ordinal.
--800A0CC1
--Source ADODB.Recordset
Set oCmd = Nothing
oConn.Close
Set oConn = Nothing
----------------------------------------------------------- Tag: Remote Assistance Tag: 191321
Creative ways to time scripts?
What I mean by "creative" is to avoid using Wait/Pause/Whatever
commands, but commands that also don't do anything. The command
would try to get the system to tell when the current program is
ready for input and the next script line should be executed. I
realize that is a difficult task, and that timing oftentimes depends
on the circumstance. Any guesses would be appreciated.
My application for scripting is typically within Windows
applications other than Internet Explorer.
Thank you. Tag: Remote Assistance Tag: 191319
Firewall Exceptions
I am trying to run the script below. It only works if the remote XP
firewall is turned off. What exceptions do I need to allow this to run ? - I
have already allowed remote administration exceptions via group policy - it
did not help.
strComputer = inputbox("Enter a computer name to run WUA detectnow","Invoke
detectnow")
if strComputer = "" then wscript.quit
on error goto 0
Set autoUpdateClient =
CreateObject("Microsoft.Update.AutoUpdate",strComputer)
AutoUpdateClient.detectnow()
wscript.echo "All done." Tag: Remote Assistance Tag: 191318
Renaming Files
Is there an easy way to rename all the files within a folder? My
specific situation is that I have a few hundred photos in a folder and I
want to rename them all as a number, starting at 199, so the first photo
would be called 199.jpg, the second 200.jpg, then 201.jpg, and so on.
I'm sure it would be using some kind of a loop while adding 1 each loop
but i wouldn't even know how to start. For now I'll just rename them all
by hand like I've always done. What a pain that is!
TIA,
Jim Tag: Remote Assistance Tag: 191312
How to determine which process has a lock on Application Event log?
Windows3k Enterprise server
Cannot access Application event log getting message
"unable to read the contents of this event log" and refreshing App Evt
log will also give same error message.
When this happens, I also get "Cannot open application: Error while
opening key" message
when trying to access
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application"
key
What could be the cause of this situation? How to determine which
process has a lock on Application Event log? Thank you. Tag: Remote Assistance Tag: 191310
TIFF image size
I need to find the width and height (in pixels) of TIFF images, using
VBScript and Windows shell scripting. These are _not_ multipage images.
I've looked all over the web and the groups, and although there are
ways to do this, I need a way that I can put on non-tech people's WinXP
machines without installing any other software. If it involves
retrieving info from Picture Manager, that's okay, since that's a
standard utility. Though I'm very fuzzy on how I would do that...I'm no
expert at VBScript or WSH.
I should clarify that I'm not just getting these dimensions and
stopping there -- zillions of tools, including Picture Manager, could
do that and I would just have my users use them out of the box. But I
have to do some calculations based on the retrieved values and present
them in an browser-based dialogue. So far the tool I'm building does
fine with bmp, jpeg, and gif; tiff is the only other format that I
really need.
TIA --- Tag: Remote Assistance Tag: 191308
reverse xcopy
Hi, I'm looking for a batch/script to schedule that compares multiple
matching source and destination folders (plus subfolders and wildcards) and
deletes any files/folders from the destination that do not exist in source. Tag: Remote Assistance Tag: 191301
Creating AD subnets
I am trying to write a script to create subnets that are associated with AD
sites. The example below has just one being created, but I'll add reading
from a text file once this one works. "This simply returns an invalid dn
syntax has been specified."
Thanks in advance for any suggestions.
strSubnetRDN = "CN=172.16.43.96/26"
strSiteObjectRDN = "CN=CHFS-ColdHarbor"
strDescription = "CHFS Subnet"
strLocation = "CHFS-ColdHarbor"
'************************************************************************************************************************
'
'Set objRootDSE = GetObject("LDAP:RootDSE")
'
'strConfigurationNC = objRootDSE.Get("configurationNamingContext")
'wscript.echo(strConfigurationNC)
'
'************************************************************************************************************************
' Determine the Site Object Distinguished Name
'************************************************************************************************************************
'Note: I think the problem is with this line:
'strSiteObjectDN = strSiteObjectRDN &
",CN=Subnets,CN=Sites,CN=Configuration,DC=ds,DC=ky,DC=gov," '&
strConfigurationNC
'
' 1) First one is that the CHFS-ColdHarbor is not in Subnet, but directly
under Sites. so remove CN=Subnets
' 2) There is a comma after gov in the string. remove it too. You now
should have the following line:
'************************************************************************************************************************
strSiteObjectDN = strSiteObjectRDN &
",CN=Sites,CN=Configuration,DC=DS,DC=KY,DC=GOV" '& strConfigurationNC
wscript.echo(strConfigurationDN)
'************************************************************************************************************************
'************************************************************************************************************************
' Determine the Subnet Container
'************************************************************************************************************************
strSubnetsContainer =
"LDAP://CN=Subnets,CN=Sites,CN=Configuration,DC=DS,DC=KY,DC=GOV" '&
strConfigurationNC
wscript.echo(strSubnetsContainer)
Set objSubnetsContainer = GetObject(strSubnetsContainer)
'************************************************************************************************************************
'************************************************************************************************************************
'Create and set the object properties.
'************************************************************************************************************************
Set objSubnet = objSubnetsContainer.Create("subnet", strSubnetRDN)
objSubnet.Put "siteObject", strSiteObjectDN
'objSubnet.Put "description", strDescription
'objSubnet.Put "location", strLocation
wscript.echo ("Subnet RDN = " & strSubnetRDN)
wscript.echo ("Site Obj RDN = " & strSiteObjectRDN)
wscript.echo ("Site Obj DN = " & strSiteObjectDN)
wscript.echo ("Subnet Container = " & strSubnetsContainer)
wscript.echo ("Desc = " & strDescription)
objSubnet.SetInfo Tag: Remote Assistance Tag: 191300
Find Newest File
I am trying to write a script to email the newest / latest NTBackup backup
log in a directory. We backup the system state twice a day and would like
the log to emailed via the same vbscript.
I know how to send the email, I need help with finding the newest file in
the given directory.
Since we do two backups a day (07:00 and 21:00), and ntbackup increments the
log file by one each time, how do I set the latest filename and path to be a
varible to be used later?
Thanks
--
Thank You,
Keith Templin Tag: Remote Assistance Tag: 191298
where can I download wzzip.exe which can be used with winzip 8.0 version
Hi all,
I am having winzip 8.0 evaluated version.I want to use wzzip
,wzunzip commands.where can I get the download of wzcline.exe which can
be used with winzip 8.0 version.
wzcline.exe proivided in http://www.winzip.com/getsite.cgi?wzcline.exe
can be used with winzip 10.0 version only.
Thanks in advance. Tag: Remote Assistance Tag: 191296
How to check client printer status
Hi
I need to create a web page that checks the client printer status. Also I
need to print text messages through the printer without showing the page
setup window.
Is this possible?
Any code examples?
What security options do I have to enable to make this work? Tag: Remote Assistance Tag: 191288
Get First Node.text in Array
I have an .xml file and can enumerate all the values I need, however I only
need to return the first Value.
strValue returns the correct string value but also all the other values in
the Array, how do I just get the first value rather than all values?
Below is my code:
'****************************
' Retrieve array of Node's
Set xmlRoot = xmlDoc.documentElement
Set nodelistID = xmlDoc.SelectNodes("SecScan/Check/Advice")
for each node in nodelistID
strTest = trim(node.text)
wscript.echo strTest
next
'*******************************
Thanks! Tag: Remote Assistance Tag: 191286
Closing a variable
I have heard a lot of conflicting reports/advice and was wondering if someone
could finally put a question to rest for me. I am programming .asp (vbscript)
pages with IIS 6.0. My question is if I declare a variable within a .asp
page, how or when is it destoryed (cleared from memory)?
Does IIS 6.0 automatically destory it when the page closes out?
Do I need to manually close/destory it (Set somevariable=Nothing)?
I have heard that if you do not manually close out each variable you
declare, then you can create a memory leak within IIS 6.0...which would be
bad.
Though on the flip side I have heard that when you simply browse away from a
page, IIS 6.0 will automatically close the variables for you?
If in fact you do need to manually close out each variable you declare, is
there a debugging tool available that I could use to check my programming to
make I didn't forget to close out any variables? I have searched around the
net and have found nothing for .asp (vbscript) pages.
Thank you in advance you for advice!! Tag: Remote Assistance Tag: 191283
Any Help to get me started would be appreciated.....
Hi;
I have virtually no Web or HTML programming experience though I am
capable of VB, Basic and and a few other programming languages.
What I was trying to get some help on would be a simple program or
script that I could run that would allow me to retrieve info from a
site that when I have multiple queries. For example I am at site
GoJoe.com (example only) and if I want to get the detail data on recipe
xyz i have to put in a field xyz and when the page refreshes I then
select "get detail recipe" link which then asks me if I want to save
the text file to my pc. Which I respond yes to and then it saves. This
is great but the problem is if I have 20 or 30 reciepies I have to go
through this loop for every one.
I there a simple script that I could get to read a txt file that would
have the recipes already loaded in like (xyz, abc, mno, etc....) that
would read the recipe, then go to the address that I would have gone to
when I click "get detail recipe", have it pull the detail information
and save it automatically to my PC. Complete this until the txt file
runs to it's end.
Sounds relatively simple it's just I don't have the Web develop skills
for the code. Can anyone offer some starter help with this? I'm sure
I could debug things once I got started.
Thanks in advance for any help.
Dave Tag: Remote Assistance Tag: 191278
convert number to character
I am fairly new to vbscript. What is the function to convert a numberic
field to a character field in a query?
Thanks in advance. Tag: Remote Assistance Tag: 191277
Printer Port Name
Does anyone one know how I can create a VB script that will check for a
printer port name (IP_IP address) and if the printer port name exists it will
exit the script?
Thanks, Tag: Remote Assistance Tag: 191272
XML extraction
My question is probably fairly easy to answer, but I've searched the
groups and haven't found anything that is close to what I'm looking
for. It's probably because I don't know what to search on which
isn't unusual. Here is an extract of data from an XML file that I'm
working with.
<vocabulary>
<term id="K442490" parentid="K352208">
<synonyms language="EN-GB">
<synonym string="St Marks Church-in-the-Bowery" preferred="YES"/>
<synonym string="church-in-the-bowery"/>
<synonym string="church-on-the-bowery"/>
<synonym string="saint mark;s church in the bowery"/>
<synonym string="saint mark;s on the bowery"/>
<synonym string="st marks"/>
<synonym string="st marks church on the bowery"/>
<synonym string="st marks-on-the-bowery"/>
<synonym string="st. marks-on-the-bowery"/>
</synonyms>
<synonyms language="EN-US">
<synonym string="St Marks Church-in-the-Bowery" preferred="YES"/>
<synonym string="church-in-the-bowery"/>
<synonym string="church-on-the-bowery"/>
<synonym string="saint marks church in the bowery"/>
<synonym string="saint marks on the bowery"/>
<synonym string="st marks"/>
<synonym string="st marks church on the bowery"/>
<synonym string="st marks-on-the-bowery"/>
<synonym string="st. marks-on-the-bowery"/>
</synonyms>
</term>
</vocabulary>
What I'm trying to do is search another recordset for the K#### and
replace it with the "preferred" EN-US string. I can get the first
recordset broken out the way I need it, but what I can't figure out is
how to pull the two pieces of info from this XML file and have them
searchable. There are about 80k terms that will need to be broken out.
Any help would be greatly appreciated. Tag: Remote Assistance Tag: 191269
saving a web image to the hard drive
Hi everyone, I hope I am in the right place, I do not know anything
about VB or scripting but I think this is the answer? I need to be
able
to grab a web image and save it to my local computer in a specific
folder. The image will
change periodicaly and I need it to save a new version every minute or
so, overwriting the previous file but keeping the same name.
Any help or a push in the right direction would be greatly appreciated!
Thank you
Dan Tag: Remote Assistance Tag: 191268
SendKeys "{Move 107,672}" ???
In the documentation for Dragon NaturallySpeaking Professional,
there is this example for SendKeys.
SendKeys "{Move 107,672}"
I simply cannot get the Move command to work.
Is there any way to neatly move the cursor using SendKeys?
I have a workaround using UpLeft since the user interface isn't
bothered by a mouse button up, but I'm really curious about the
apparently dysfunctional but included Move command.
Thank you. Tag: Remote Assistance Tag: 191265
Missing home dir when account created by vbscript
When I create an account using vbscript I also create the home dir for the
user and populate the homeDir properties of the account. There are no errors
creating the directory and there are no errors populating the homeDir
property of the account. Using Active Directory Users and Computer (ADUC) I
can see that the account was created and that the home dir was set properly.
Checking the drive for the dir reveals it is created and the rights are
assigned correctly.
The problem is at login. When you login with one of these accounts the user
does not get a mapping to their home dir. Yet if they use the run cmd they
can open the dir and utilize it.
We suspect it has something to do with what gets input to the homeDir
property but I'm unable to determine that there is anything wrong with it.
Interestingly if I modify the home dir property in ADUC (so the apply button
becomes active) and then switch it back to what was there then click apply,
when the user logs in their home dir appears correctly for them.
Any ideas? Tag: Remote Assistance Tag: 191260
Filtering via OU
Hi folks,
Quick question. I wish to do a search on a whole domain, but I wish to
exclude specific domains.
My current search is this:
' Retrieve lastLogon attribute for each user on each Domain Controller.
For k = 0 To Ubound(arrstrDCs)
strBase = "<LDAP://" & arrstrDCs(k) & "/" & strDNSDomain & ">"
strFilter = "(&(objectCategory=person)(objectClass=user))"
strAttributes = "distinguishedName,lastLogon,description"
strQuery = strBase & ";" & strFilter & ";" & strAttributes &
";subtree
(thanks to Richard Mueller for large bits of the script)
Basically, I wish to exclude say two OUs called OU=disabled
users,DC=domain,DC=com & OU=resource accounts,OU=users,DC=domain,DC=com
- how is this done? I can get a filter using "memberof", but that is
member of a group rather than a member of a OU sadly.
Thanks in advance!
Rich Tag: Remote Assistance Tag: 191256
Methods to use with the registry
Hi,
I've used this line before:
If objFSO.FileExists("C:\Program Files\Microsoft
Office\Office10\Winword.exe") Then
Is there a method similar to this to check if a registry value exists?
Thanks in Advance,
JeffH Tag: Remote Assistance Tag: 191248
Import a third party root certificate
Hello,
can I generally import a x509 certificate into ca. 350 Windows -Client using
a script ?
Thanks
Peter Tag: Remote Assistance Tag: 191247
Editing txt file.
Hi!
Here's what I need to do:
I have a text file of 141 lines which contains data considering
web-application. In line 5 of the txt-file, the username is introduced.
Now I would need a script, which would ask me the username, and then
the script would modify the Username section, in the line 5 of the
text-file.
So basicly I would need a "Username" -variable. The value of "Username"
would be entered by a user, and then the script should input the value
to the text file.
Do you have any ideas which would be an easy way to accomplish this? It
seems that FileSystemObject cannot modify text-files, is that right?
Thanks in advance,
Henri Tag: Remote Assistance Tag: 191245
sorry but i have an exchange 5.5 question :(
i need to write a script that would be simple for exchange 2000 or 2003, but
i have to run it against a 5.5 org.
the script only has to list all mailboxes on a particular server, and the
current size of the mailbox. ill make it write to a spreadsheet, but does
anyone know how i can get the info from 5.5 with vbscript?
thank you very much Tag: Remote Assistance Tag: 191242
variable construction from ASP form values
Hi all--
I am trying to handle a series of indexed values passed via "post" from
a form on an ASP page. Could someone explain why the following code
separates variables with "<br>" but seems to fail with ", "? When I
change the line indicated by "<===****" I only get the first value.
Interestingly, changing "<br>" to "<, >" gives me "[value]<, >[value]<,
>[value]<, >".
Result (separating with "<br>"):
"Value list: 3
5
7"
Result (separating with ", "):
"Value list: 3"
And how I can construct a variable in the format "[value], [value],
[value], "?
Thanks!
steve
===== code from ASP file ====
<%option explicit%>
<html>
<body>
<%
dim lngTotal, strSelected, i
lngTotal = Request.form("SelCat").Count
strSelected="Value list: "
For i = 1 To lngTotal
strSelected=strSelected & Request.form("SelCat")(i) & "<br>" <===****
Next
Response.Write("<br>")
response.write(strSelected)
%>
</body>
</html> Tag: Remote Assistance Tag: 191241
Retrieve Parameter from location bar
Hi Everybody
I have an Access database that passes a Parameter to a web page
something like this.
http://localhost/index.htm?paramName=1234-54321
I want to be able to retrieve the parameter (In this example
1234-54321) and pass it to a hidden text box on a form. Something like
the one below...where it says <IN HERE>
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr"
method="post">
<input type="hidden" name="item_number" value="<IN HERE> Upgrade from
Free Version to Standard Version">
</form>
I am a VBscript Virgin so please be gentle with me.
Any help gratefully received
Bob Tag: Remote Assistance Tag: 191239
Extracting Name Value Pairs
Hi I have a long line of text that I want to parse for name/value pairs
see example below
( note:
- it is a one long line so please remove linebreaks, and
- I have replaced tabs with the pipe for clarity)
I am trying to regex to extract the name/value pairs; perhaps I could just
use a split function (this just occured to me as I pasted the example below.
Nevertheless, can i use RegEx to extract name value pairs?
the pattern i am came up with (whch I bet could be improved) is
Patrn1 = ""
Patrn1 = Patrn1 & "\t*([\w]+)\t([\w \/\x22]+)\t*" ' first value pair
Patrn1 = Patrn1 & "\{\t*(Alignment)\t([\w \x22]+)" 'second value pair to
account for the bracket; I suppose I could replace it with nothing
Patrn1 = Patrn1 & "(\t*([\w]+)\t([\w \x22]+))+" 'third value pair, which
should repeat but does not...
thanks in advance for your assistance.
Regards
Habib
------------------------------
||||ReportCalculatedField|"328"||||||||{|||||Alignment|"right"|||||BackColor|"Transparent"|||||CalculatedField|"Apply
Bucket
1"|||||DisplayOptions|"HideWhenEmpty"|||||DisplayType|"Data"|||||Font|"Helvetica
(generic)"|||||FontBold|"false"|||||FontColor|"Black"|||||FontItalic|"false"|||||FontSize|"7"|||||FontUnderline|"false"|||||Format|""|||||FormatField|"'Func/Rept
Index'"|||||Pattern|"(none)"|||||PatternColor|"White"|||||PositionLeft|"365"|||||PositionTop|"256"|||||ReadingOrder|"LeftToRight"|||||SizeHeight|"8"|||||SizeWidth|"72"|||||ZOrder|"116"||||}
------------------------------
--
www.DynExtra.com
A resource for the Microsoft Dynamics Community
Featuring FAQs, File Exchange and more
Current member count: 21
--------------------------------------------
Share your knowledge. Add your favorite questions and answers
Help add questions to this site! We want Your input. Tag: Remote Assistance Tag: 191235
Newbie scripting. Modifying the registry.
I have been assigning nic speeds for a couple years on all new boxes
that we build in our datacenters manually. I finally got fed up and
picked up some vbscript books which have been a great help managing
some redunant tasks i must do, but this one stumps me.
Key Name:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}
Under each subkey there is a string value of "SpeedDuplex" with a value
ranging from 0+
100/full is 4 auto/auto is 0
If the device is not a physical hardware nic, it will not have the
SpeedDuplex Key, which is a plus for finding real devices vs
virtual/software ones.
What I am trying to do is run through each subkey and its strings and
change any that have a string of "SpeedDuplex" with a value of 0 to 4.
Im not sure about how to loop through all the keys to do this.
Any help would be appreciated.
Thx
C Tag: Remote Assistance Tag: 191234
cannot pass LDAP query with "/"
Hi there,
i just need some help with an LDAP Query.
I am writing a VB Script that prints out all the members of a
Distribution list/Security group, and also prints out their details
such as name, email, title, etc for security purposes.
I am experiencing a problem when trying to print out the members on a
DL called:
"All Managers/Directors"
The problem seems to be with the "/" in the DL's name, as all other
groups without the "/" work fine.
The full Distingushied name of the object is:
CN=All Managers/Directors,OU=Contacts DL,OU=Distribution Lists,
DC=xxx,DC=xxx,DC=xxx,DC=xxx
the LDAP Query wont find the object..The ldap query is as:
'use ASCII char "47" to replace "/" in DN
strGrp = "CN=All Managers" & chr(47) & "Directors,OU=Contacts
DL,OU=Distribution Lists,DC=xxx,DC=xxx,DC=xxx,DC=xxx"
Set objGroup = GetObject _
("LDAP://" & strGrp)
objGroup.GetInfo
when i run this i get the following error:
C:\prntSecGrp.vbs(22, 1) (null): 0x80005000
I have run this with the ASCII char and without, both with no luck. Any
help would be greatly appreciated!
Regards
K. Tag: Remote Assistance Tag: 191233
XCopy using If and Then Statements
New to this, and I don't quite comprehend something.
I need a batch file that copies SPECIFIC files from a Network Directory to
C:\123_Software\ folder.
@ECHO OFF
Rem Copy \\ServerName\123_Software to Clients \123_Software folder.
XCOPY \\servername\123_Software\ABCD.EXE C:\123_Software\ /S /E
XCOPY \\servername\123_Software\1234.EXE C:\123_Software\ /S /E
XCOPY \\servername\123_Software\XYZ.EXE C:\123_Software\ /S /E
The difficulty is this:
I am tying this to a GPO which works just fine, but I want to ensure I am
not sending these files to each client everytime they log into the etwork.
As these files are 13.5 MB, 9.5 MB, and 1.5MB.
What I need is something that looks to see if File on Client Machine has the
same date and time as file on Network, then go to next file.
Either a Batch file, or a VBS script will work perfectly. Tag: Remote Assistance Tag: 191232
Finding out who modified a file
Is there any way of finding out *who* modified a particular file using
VBS? It's in a W2K domain, but it's on a PC that's not running W2K
Server, just plain W2K. Tag: Remote Assistance Tag: 191231
schtasks - how to?
I am trying to run the following:
schtasks /CREATE /Tn "Startup Tasks" /Tr "cmd /V:on /C
\"C:\startup\StartupTasks.cmd \" AUTO" /SC ONLOGON
However I need the start in folder to be 'startup' not 'cmd' as it seems to
always be set to. I know you can change it with the gui, but I really would
much prefer to do at the command prompt. Is it possible?
btw the reason I am using the cmd is so I can set /V:on - I don't want to
have to do this in the registery.
Cheers, Tag: Remote Assistance Tag: 191229
Running Remote Processes (2000 PC to XP PC)
Hi,
I am trying to run this script from MSDN to start a remote notepad on an XP
workstation. I am running the script from a Win2K Server. It fails with error
3 "Insuffiicient privilege" It runs fine from XP to 2000.
Here is the code.
Const SW_NORMAL = 1
strComputer = "remoteWstn"
strCommand = "Notepad.exe"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate & authenticationLevel=Pkt}!\\" _
& strComputer & "\root\cimv2")
' Configure the Notepad process to show a window
Set objStartup = objWMIService.Get("Win32_ProcessStartup")
Set objConfig = objStartup.SpawnInstance_
objConfig.ShowWindow = SW_NORMAL
' Create Notepad process
Set objProcess = objWMIService.Get("Win32_Process")
intReturn = objProcess.Create _
(strCommand, Null, objConfig, intProcessID)
If intReturn <> 0 Then
Wscript.Echo "Process could not be created." & _
vbNewLine & "Command line: " & strCommand & _
vbNewLine & "Return value: " & intReturn
Else
Wscript.Echo "Process created." & _
vbNewLine & "Command line: " & strCommand & _
vbNewLine & "Process ID: " & intProcessID
End If
This is taken from the following link
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/create_method_in_class_win32_process.asp Tag: Remote Assistance Tag: 191220
csv/excel file
Hello there,
I know this is a wrong place.
I have an csv file of sAMAccountNames of 50 users. They are all scattered
in different OUs in a domain.
I would like to retrive homeMDB attribute of these users.
Does anybody have a sample script or atleast direct me to right place?
Second question:
How do I executive another vbscript from withing a vbscript?
for example, I want to write a vbscript that executives c:\test.vbs >>
test.txt
Thanks in advance Tag: Remote Assistance Tag: 191219
DHCP
The snippet below is directly from the Portable Script Center. Works great
locally and as a login script (removing the echo's of course).
My question is what is the point of the strComputer = "." line? Or rather
the "." on that line. I know the "." indicates the local PC, but I've been
under the impression that you could enter a remote machines name (on the same
network) instead of the period, and the script would apply to that remote
machine. However, it doesn't work that way. I've tried other scripts like
the reboot script that don't work either. If all the script apply to the
local machine anyway, why do we need the strComputer = "." line?
Can anyone update me as I appear to be misinformed?
---------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each objNetAdapter In colNetAdapters
errEnable = objNetAdapter.EnableDHCP()
Next
--------------
Thanks for any help or suggestions!
-Steve Tag: Remote Assistance Tag: 191216
Shinbaum or Anyone...
Hi Shinbaum or Anyone...
Can you help to create a function to destroy connection as Shinbaum
sad??
http://groups.google.com.br/group/microsoft.public.scripting.vbscript...
Please look this topic... Tag: Remote Assistance Tag: 191212
SCHTASKS help
I'm trying to schedule a task with SCHTASKS. I'm having trouble
creating it. Here's how I attempt to create it.
schtasks /Create /SC DAILY /ST 10:29:00 /TN "myTaskName" /TR
"C:\myBatchFile"
After executing that, I am prompted to
"Please enter the run as password for USER:"
I don't know what that is, so I just make one up. I am warned that it
may not run correctly, and it doesn't run correctly.
Is there a way to skip the password thing? This is a public computer,
so I don't want to bog things down with passwords.
Thanks! Tag: Remote Assistance Tag: 191208
Hello,
i need a script to enable the Remote Assistance in WXPsp2.
"Cristian Baldo" <cristian.baldo@bica.com.ar> wrote in message
news:uvXAuSddGHA.536@TK2MSFTNGP02.phx.gbl...
> Hello,
> i need a script to enable the Remote Assistance in WXPsp2.
>
> Thanks.
>