Set primary group
I try to set the primary group.
Set objGroup = Getobject(strLDAPPriGroup)
objGroup.GetInfoEx Array("primaryGroupToken"), 0
intPrimaryGroupToken = objGroup.Get("primaryGroupToken")
but i get the Error 0x80005000
Code 80005000
This happens on a Windows 2003 Enterprice DC
Can any one help me?
Thanks already.
Sjoerd Tag: Try on this internet package Tag: 144229
consistent modified file date format
Hello,
I've written a pretty simple .asp page that displays the file name and date
of a file on the server. When I move this .asp page onto a different server
the modified file date format is not the same as it was on my server. I am
sure the settings on the server where the page is located are much different
than mine, nonetheless I still need to display the proper modified file
date.
On my server the modified file date is displayed as this (after I trim the
string of course)
M/DD/YYYY
On the current server the format looks like this:
M/D/YY
So is there a way for me to build the modified file date? I tried using the
DatePart function on the pointer to the fileObject but it didn't work.
Can this be done?
Cheers,
devin M. arnold
The code looks like this:
<%
Dim oFolder, oFile, oFSO, oFolderCollection, oSubFolder, oBracketToggle,
oCommaToggle
myFolder = Request.QueryString("myFolder")
set oFSO = Server.CreateObject("Scripting.FileSystemObject")
set oFolder = oFSO.GetFolder(Server.MapPath(myFolder))
Response.Write "["
totalFiles = oFolder.Files.Count
fileCounter = 1
For Each oFile In oFolder.Files
myFileName = UCase(oFile.Name)
' lets filter out the files we want to use for the kiosk
if InStr(myFileName, ".BMP") <> 0 OR InStr(myFileName, ".JPG") OR
InStr(myFileName, ".GIF") then
myStr = oFile.DateLastModified
myCharPos = InStr(myStr , " ")
myModifiedDate = Left(myStr, (myCharPos-1))
myFileDay = DatePart("D", myStr )
myFileMonth = DatePart("M", myStr )
myFileYear = DatePart("YYYY", myStr )
Response.Write "myStr =" & myStr
Response.Write "myFileDay =" & myFileDay
Response.Write "myFileMonth =" & myFileDay
Response.Write "myFileYear =" & myFileDay
if fileCounter >= totalFiles then
Response.Write Chr(34) & myFileName & Chr(34) & ": " & Chr(34) &
myModifiedDate & Chr(34)
ELSE
Response.Write Chr(34) & myFileName & Chr(34) & ": " & Chr(34) &
myModifiedDate & Chr(34) & ", "
fileCounter = fileCounter + 1
end if
end if
Next
Response.Write "]"
Set oFSO = Nothing
%> Tag: Try on this internet package Tag: 144228
Setting Permissions on OU
Is there a way to set the Permissions on OU via script?
(on windows 2003 AD)
Thanks,
Tal. Tag: Try on this internet package Tag: 144227
1. Found a fatal bug in WinXP... 2. Delete in the Registry when backslash...
Hi,
I found a new security problem in Windows XP that could (most likely,
already happening) delete your data. Microsoft do not know about it..
Read more: http://users.cybercity.dk/~bse26236/tweak/tweak.htm#OOPS
Benny,
PS.
Here is a VBS solution that shows how to delete a variable in the
Registy
that contains a backslash. (The normal way wont work).
' SkipReg.VBS by Benny Pedersen, http://2dos.homepage.dk/
' Oct 3, 2003. Tested on WinXP.
dim wsh: set wsh = createObject("wScript.shell")
dim fso: set fso = createObject("scripting.fileSystemObject")
dim exportFile, key
exportFile = fso.getSpecialFolder(2) & ".\export.reg"
key="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion" &_
"\SharedDLLs"
if not fso.fileExists(exportFile) then
wsh.run("regedit /e """ & exportFile & """ """ & key & """"),, 1
else key = ""
end if
if key = "" or not fso.fileExists(exportFile) then
msgBox "Export failure. ", vbInformation, "Error"
if key = "" then wsh.run "explorer " & fso.getSpecialFolder(2)
else dim importFile, i, regVariableNames, numbOfVar2delRequest
importFile = fso.getSpecialFolder(2) & ".\import.reg"
i = "*"
regVariableNames =_
i & "C:\KPCMS\DCPDB\ADOBERGB.PT" &_
i & "C:\KPCMS\DCPDB\PHCDCN01.PT" &_
empty
regVariableNames = split(regVariableNames, "*")
numbOfVar2delRequest = uBound(regVariableNames)
if numbOfVar2delRequest > 0 then skip()
end if
set wsh = nothing
set fso = nothing
sub skip()
dim rFile: set rFile = fso.openTextFile(exportFile, 1)
dim wFile: set wFile = fso.openTextFile(importFile, 2, true)
dim numbOfVar2delFound, counter, rLine, ascii, w, i, ugly, eNote
numbOfVar2delFound = 0: counter = -5
do: on error resume next: rLine = rFile.readLine
if err <> 0 then exit do
on error goto 0
for each ascii in array(0,10,13,254,255)
rLine = replace(rLine, chr(ascii), "")
next
w = true
for i=1 to numbOfVar2delRequest
ugly = """" & replace(regVariableNames(i), "\", "\\") & """="
if ugly = left(rLine,len(ugly)) then _
numbOfVar2delFound = numbOfVar2delFound+1: w = false: exit for
next
counter = counter +1
if w then wFile.writeLine rLine
loop
rFile.close: set rFile = nothing
wFile.close: set wFile = nothing
if numbOfVar2delFound < 1 then
err.raise(6)
else err.clear
wsh.regDelete key & "\"
' NOTE: Cannot delete a key that contains subkey(s).
end if
select case err
case 0: eNote = "Succeeded."
case 6: eNote = "No match."
case else: err.clear: err.raise(17): eNote = err.description
end select
on error goto 0
if eNote = "Succeeded." then
wsh.run("regedit """ & importFile & """"),, 1
fso.deleteFile importFile
wsh.run("regedit /e """ & importFile & """ """ & key & """"),, 1
if not fso.fileExists(importFile) then
eNote = "FATAL ERROR."_
& string(2,vbLf) & "You just answered [NO] to put " &_
counter - numbOfVar2delFound & " variable back to the Registry"_
& " that was removed. " & string(2,vbLf) & "IMPORTANT: " &_
"To restore your system, run this file:" & string(2,vbLf) &_
"""" & exportFile & """," & string(2,vbLf) &_
"then restart """ & wScript.scriptFullName & """"
end if
end if
msgBox "Request: Delete " & numbOfVar2delRequest &_
" variable from the Registry." & vbLf & "Result: Found " &_
numbOfVar2delFound & "." & string(2,vbLf) & eNote, vbInformation,_
left(eNote,inStr(eNote,"."))
if fso.fileExists(importFile) then
fso.deleteFile importFile
fso.deleteFile exportFile
else wsh.run "explorer " & fso.getParentFoldername(exportFile)
end if
end sub Tag: Try on this internet package Tag: 144226
Search documentation scripting
Hello everybody,
I don't know a scripting, but I want to learn it.
Do you know a good site ? or a good book?
Regards Tag: Try on this internet package Tag: 144208
FileSystemObject
Hi,
Creating ASP page in Visual Interdev 6.0 with VBScript.
Trying to get all folders under each drive.
Code...
Dim fso, folder, s, subFolders
Set FSO = CreateObject("Scripting.FileSystemObject")
' Get Drive object.
Set folder = fso.GetFolder("c:")
Set subFolders = folder.SubFolders
' Print parent folder name.
Response.write "Parent folder name is: " & folder & "<BR><BR>"
For Each folder in subFolders
Response.Write "FolderName: " & folder.Name & "<br>"
Response.Write "Attributes: " & folder.Attributes & "<br>"
Response.Write "Type: " & folder.Type & "<br>"
Response.Write "Size: " & folder.Size & "<br>"
Response.Write "ShortName: " & folder.ShortName & "<br>"
Next
______________
fso.GetFoler("A:") - Parent folder name is:
- Works fine.
fso.GetFolder("C:") - Local drive. Parent folder name is:
"C:\winnt\System32" - Displays folder appmgmt to dhcp.
Microsoft VBScript runtime error '800a0046' Permission denied error after
that.
fso.GetFolder("D:') - Local
- Page cannot be displayed or Microsoft VBScript runtime error
'800a004c' Path not found. fso.GetFolder("H:") - CD-Rom
- Works fine.
fso.GetFolder("E:") - Mapped
- Page cannot be displayed or Microsoft VBScript runtime error
'800a004c' Path not found.
Not sure why C:\ drive parent is "winnt\System32" directory instead of
"C:\".
Not sure why D (local) and E (mapped) drive cannot be found.
Help in this matter is greatly appreciated.
- Reena Tag: Try on this internet package Tag: 144205
Script to launch another script
I am trying to get a master script to launch small scripts as jobs and pass
parameters on to the second script.
I construct the commandline from an XML file and the exact syntax is as
follows:
<!--
cscript C:\vb\ECH\MCP\copier.vbs C:\vb\ECH\ECHO V2\upload\1\batch.txt
C:\vb\ECH\MCP\batch.txt
-->
1.)copier.vbs is the second script to be called
2.)the first param is basically the source filepath
3.)the second param is the target filepath
here is the sysntax I am using to call the other script.
CommandLine = script & " " & filepath & " " & parampath & filename
Set WshShell = CreateObject("WScript.Shell")
WshShell.Exec(CommandLine)
Brian Tag: Try on this internet package Tag: 144200
Simple assignment of function return value fails - vbs Rusty
This is probably a really simple error, but I haven't been able to
resolve it. Your help would be much appreciated.
I return an array of objects from a function. I'm trying to assign
the result to an array without success. The code from a) the script
and b) an xml file follows. Don't get bogged down in the xml. I
think this is a really basic problem as I am rusty with vbs.
The error message is: Type Mismatch 800A000D. The error occurs on the
very last line of the script.
TIA...
'//**************************************************************
'//**************************************************************
' VB Script Document
Class Department
private deptName
private drives()
private printers()
Public Function setDeptName(strName)
deptName = strName
End Function
Public Function getDeptName()
getDeptName = deptName
End Function
Public Function setNumDrives(intNumDrives)
Redim Preserve drives(intNumDrives,1)
End Function
Public Function setDrive(row,col,val)
drives(row,col) = val
End Function
Public Function get2dDriveAry()
get2dDriveAry = drives
End Function
Public Function setNumPrinters(intNumPrinters)
Redim Preserve printers(intNumPrinters)
End Function
Public Function setPrinter(row,val)
printers(row) = val
End Function
Public Function getPrinterAry()
getPrinterAry = printers
End Function
end class
function getDrivesNPrintersByDept (xmlRscFile)
'array used to store a collection of Departmental Resource objects
dim aryRscObjects()
'*** Local object used to store Resource info ***
dim oDeptResource
set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load(xmlRscFile)
Set ElemList = xmlDoc.getElementsByTagName("department")
'*** Iterate through by department ***
For i=0 To (ElemList.length -1)
'*** Get an new object
set oDeptResource = New Department
'*** print xml for the departments
'msgbox ElemList.item(i).xml
'***GET THE NAME
set dept_name= ElemList.item(i).childnodes(0)
oDeptResource.setDeptName dept_name.text
'***GET THE DRIVES
set drives = ElemList.item(i).childnodes(1).childnodes
'*** dim the array to the correct size
oDeptResource.setNumDrives(drives.length-1)
'*** iterate through the drives ***
For k=0 To (drives.length -1)
oDeptResource.setDrive k,0,drives.item(k).childnodes(0).text
oDeptResource.setDrive k,1,drives.item(k).childnodes(1).text
Next
'***GET THE PRINTERS ***
set printers = ElemList.item(i).childnodes(2).childnodes
'*** dim the array to the correct size
oDeptResource.setNumPrinters(printers.length -1)
For l = 0 To (printers.length -1)
oDeptResource.setPrinter l,printers.item(l).childnodes(0).text
Next
'*** expand the array to hold one more w/o losing current contents
redim preserve aryRscObjects(i+1)
'*** add the current object to the array
set aryRscObjects(i) = oDeptResource
Next
'*** return the array
getDrivesNPrintersByDept = aryRscObjects
end Function
'*** MAIN ***
dim aryRscs()
strXmlFile = "myXML.xml"
aryRscs = getDrivesNPrintersByDept strXmlFile
'//**************************************************************
'//**************************************************************
<?xml version="1.0" ?>
<!-- the first printer in the list of printers will be the default
-->
<departmental_resource_assignments>
<department>
<name>Development</name>
<drives>
<drive>
<letter>f:</letter>
<path>\\theat\groups</path>
</drive>
<drive>
<letter>g:</letter>
<path>\\prod\development</path>
</drive>
<drive>
<letter>r:</letter>
<path>\\raiser\dev</path>
</drive>
<drive>
<letter>s:</letter>
<path>\\theat\shared</path>
</drive>
</drives>
<printers>
<printer>
<path>\\theat\dev_hp8100</path>
</printer>
<printer>
<path>\\theat\dev_hp5M</path>
</printer>
</printers>
</department>
<department>
<name>Artistic</name>
<drives>
<drive>
<letter>f:</letter>
<path>\\theat\xxxx</path>
</drive>
</drives>
<printers>
<printer>
<path>\\theat\dev_hpxxx</path>
</printer>
<printer>
<path>\\theat\dev_hpxxx</path>
</printer>
</printers>
</department>
</departmental_resource_assignments> Tag: Try on this internet package Tag: 144197
Mac characters
trying to display information in asp that contain mac
characters from SQL DB, the character appears as a
question mark in asp, ie the word icon?, an accent should
appear above the 'n' instead of a question mark beside
the 'n'.
please help
Cheers Tag: Try on this internet package Tag: 144194
Problems with updated pages
Hi!
when i make a new version of my pages and i try to test it=20
i can't see the changes, i thougt it may be caused by the=20
browser cache, but i cleaned it and tested in another=20
computer but i continue without seen the changes.
It seems that the server (iis) don=B4t processed the asp=20
page and send another processed before, stored in a server=20
buffer.=20
There any way to avoid this???
Can anybody help me?
Thanks Tag: Try on this internet package Tag: 144192
AppActivate
I am using the AppActivate statement to call a window by title, but I only
want it to run if the window is actually available. Is there a way to list
all active window titles in a collection where I can verify the window is
active? If not, is there a better way to activate a window by title only if
it is available?
TIA
Charles Tag: Try on this internet package Tag: 144190
how to call a sub or function from case..end
Hi
i need help
i am using a vbscript for exprting users info from the AD
But i do not want to export all users
users who have the user "phonehome: prperty empty -will not be exported
As shown below
each time i am using the "then call " syntax
i recieve syntax error message
is there a way of "calling" a sub or function from within case..end proceadure
....
For Each oUser In oCont
Select Case LCase(oUser.Class)
Case "user"
If IsEmpty(oUser.homephone) Then call...
End If
else
If Not IsEmpty(oUser.st) Then
OutPutFile.WriteLine "state: " & oUser.st
End If
.
.
.
End Select
OutPutFile.WriteLine
Next
End Sub
Thnks Tag: Try on this internet package Tag: 144189
movehere
What am I doing wrong?
I wish to move this user from one ou to another. The error I get is "null,
there is no such object on the server."
Yet when I change the path in the movehere statement and change the name at
the end and also to look in users current ou, it renames the account just
fine. So it does see the account, but I must be missing something to get it
to move.
Set Container = GetObject ("LDAP://yms12/OU=TestOU,DC=test,DC=org" )
Set NewObjectName = Container.MoveHere
("LDAP://cn=smoxey01,ou=TestOU,ou=sus,DC=test,DC=org","cn=smoxey01") Tag: Try on this internet package Tag: 144188
Help with Script.
Guys,
I need a little help here...
This is case, I have a batch of files that I need to edit in photoshop.
I'm trying to use the below code to accomplish this, but it seems that I'm
doing something wrong or missing something.
I need an array to bound all files of type *.jpg; then open Photoshop use
automation to do minor conversion for web viewing and go to the next.
I attempted to do this but I don't know what going on.
Any help will be greatly appreciated
Neil Pilier
npilier@miami.edu
Snipped code
--------------------------------------------------------------------
Option Explicit
Dim fso, f, f1, i, s, myArray(), ws, oAutoIt, iii
redim myArray(0)
set fso = CreateObject("Scripting.FileSystemObject")
set f = fso.GetFolder ("C:\test")
set ws = WScript.CreateObject("WScript.Shell")
set oAutoIt = CreateObject("AutoItX.Control")
For Each f1 In f.Files
redim preserve myArray(Ubound(myArray) + 1)
myArray(Ubound(myArray)) = f1.Name
Next
On Error Resume Next
for iii = 0 to ubound(myArray)
If lcase(fso.GetExtensionName(myArray(i))) = "jpg" then
ws.Run ("Photoshop.exe " & myArray(iii))
WScript.Sleep 6000
ws.AppActivate "Adobe Photoshop"
ws.SendKeys " "
ws.SendKeys "%(+^s)"
WScript.Sleep 500
oAutoIt.LeftClick 864, 296
WScript.Sleep 500
oAutoIt.LeftClick 843, 395
oAutoIt.LeftClick 843, 395
WScript.Sleep 500
ws.SendKeys "392"
WScript.Sleep 500
oAutoIt.LeftClick 864, 509
WScript.Sleep 500
oAutoIt.LeftClick 863, 56
WScript.Sleep 500
ws.SendKeys "{TAB 2}"
WScript.Sleep 500
ws.SendKeys "{ENTER}"
WScript.Sleep 500
ws.SendKeys "^(w)"
WScript.Sleep 500
ws.SendKeys "{TAB}"
WScript.Sleep 500
ws.SendKeys " "
WScript.Sleep 500
end if
Next
set fso = nothing
set f = nothing
set ws = nothing
set oAutoIt = nothing Tag: Try on this internet package Tag: 144186
Help with Script.
Guys,
I need a little help here...
This is case, I have a batch of files that I need to edit in photoshop.
I'm trying to use the below code to accomplish this, but it seems that I'm
doing something wrong or missing something.
I need an array to bound all files of type *.jpg; then open Photoshop use
automation to do minor conversion for web viewing and go to the next.
I attempted to do this but I don't know what going on.
Any help will be greatly appreciated
Neil Pilier
npilier@miami.edu
Snipped code
--------------------------------------------------------------------
Option Explicit
Dim fso, f, f1, i, s, myArray(), ws, oAutoIt, iii
redim myArray(0)
set fso = CreateObject("Scripting.FileSystemObject")
set f = fso.GetFolder ("C:\test")
set ws = WScript.CreateObject("WScript.Shell")
set oAutoIt = CreateObject("AutoItX.Control")
For Each f1 In f.Files
redim preserve myArray(Ubound(myArray) + 1)
myArray(Ubound(myArray)) = f1.Name
Next
On Error Resume Next
for iii = 0 to ubound(myArray)
If lcase(fso.GetExtensionName(myArray(i))) = "jpg" then
ws.Run ("Photoshop.exe " & myArray(iii))
WScript.Sleep 6000
ws.AppActivate "Adobe Photoshop"
ws.SendKeys " "
ws.SendKeys "%(+^s)"
WScript.Sleep 500
oAutoIt.LeftClick 864, 296
WScript.Sleep 500
oAutoIt.LeftClick 843, 395
oAutoIt.LeftClick 843, 395
WScript.Sleep 500
ws.SendKeys "392"
WScript.Sleep 500
oAutoIt.LeftClick 864, 509
WScript.Sleep 500
oAutoIt.LeftClick 863, 56
WScript.Sleep 500
ws.SendKeys "{TAB 2}"
WScript.Sleep 500
ws.SendKeys "{ENTER}"
WScript.Sleep 500
ws.SendKeys "^(w)"
WScript.Sleep 500
ws.SendKeys "{TAB}"
WScript.Sleep 500
ws.SendKeys " "
WScript.Sleep 500
end if
Next
set fso = nothing
set f = nothing
set ws = nothing
set oAutoIt = nothing Tag: Try on this internet package Tag: 144185
Payflow response
Hi everyone. Using active server page I am sending a transaction to VERISIGN
and getting a response back from verisign. The response is written to the
page through the following value.
response.write name
response.write " = "
Response.Write value
I am trying to get the response split namely the PNREF,
RESPONSE,APPROVAL,ETC and insert some information into the database and
also redirect the user to a page based on the response I get back.
Can someone please help me with a script, iam entirely new to this.
Thanks
Ola Tag: Try on this internet package Tag: 144184
Help with Script.
Guys,
I need a little help here...
This is case, I have a batch of files that I need to edit in photoshop.
I'm trying to use the below code to accomplish this, but it seems that I'm
doing something wrong or missing something.
I need an array to bound all files of type *.jpg; then open Photoshop use
automation to do minor conversion for web viewing and go to the next.
I attempted to do this but I don't know what going on.
Any help will be greatly appreciated
Neil Pilier
npilier@miami.edu
Snipped code
--------------------------------------------------------------------
Option Explicit
Dim fso, f, f1, i, s, myArray(), ws, oAutoIt, iii
redim myArray(0)
set fso = CreateObject("Scripting.FileSystemObject")
set f = fso.GetFolder ("C:\test")
set ws = WScript.CreateObject("WScript.Shell")
set oAutoIt = CreateObject("AutoItX.Control")
For Each f1 In f.Files
redim preserve myArray(Ubound(myArray) + 1)
myArray(Ubound(myArray)) = f1.Name
Next
On Error Resume Next
for iii = 0 to ubound(myArray)
If lcase(fso.GetExtensionName(myArray(i))) = "jpg" then
ws.Run ("Photoshop.exe " & myArray(iii))
WScript.Sleep 6000
ws.AppActivate "Adobe Photoshop"
ws.SendKeys " "
ws.SendKeys "%(+^s)"
WScript.Sleep 500
oAutoIt.LeftClick 864, 296
WScript.Sleep 500
oAutoIt.LeftClick 843, 395
oAutoIt.LeftClick 843, 395
WScript.Sleep 500
ws.SendKeys "392"
WScript.Sleep 500
oAutoIt.LeftClick 864, 509
WScript.Sleep 500
oAutoIt.LeftClick 863, 56
WScript.Sleep 500
ws.SendKeys "{TAB 2}"
WScript.Sleep 500
ws.SendKeys "{ENTER}"
WScript.Sleep 500
ws.SendKeys "^(w)"
WScript.Sleep 500
ws.SendKeys "{TAB}"
WScript.Sleep 500
ws.SendKeys " "
WScript.Sleep 500
end if
Next
set fso = nothing
set f = nothing
set ws = nothing
set oAutoIt = nothing Tag: Try on this internet package Tag: 144183
Help with Script.
Guys,
I need a little help here...
This is case, I have a batch of files that I need to edit in photoshop.
I'm trying to use the below code to accomplish this, but it seems that I'm
doing something wrong or missing something.
I need an array to bound all files of type *.jpg; then open Photoshop use
automation to do minor conversion for web viewing and go to the next.
I attempted to do this but I don't know what going on.
Any help will be greatly appreciated
Neil Pilier
npilier@miami.edu
Snipped code
--------------------------------------------------------------------
Option Explicit
Dim fso, f, f1, i, s, myArray(), ws, oAutoIt, iii
redim myArray(0)
set fso = CreateObject("Scripting.FileSystemObject")
set f = fso.GetFolder ("C:\test")
set ws = WScript.CreateObject("WScript.Shell")
set oAutoIt = CreateObject("AutoItX.Control")
For Each f1 In f.Files
redim preserve myArray(Ubound(myArray) + 1)
myArray(Ubound(myArray)) = f1.Name
Next
On Error Resume Next
for iii = 0 to ubound(myArray)
If lcase(fso.GetExtensionName(myArray(i))) = "jpg" then
ws.Run ("Photoshop.exe " & myArray(iii))
WScript.Sleep 6000
ws.AppActivate "Adobe Photoshop"
ws.SendKeys " "
ws.SendKeys "%(+^s)"
WScript.Sleep 500
oAutoIt.LeftClick 864, 296
WScript.Sleep 500
oAutoIt.LeftClick 843, 395
oAutoIt.LeftClick 843, 395
WScript.Sleep 500
ws.SendKeys "392"
WScript.Sleep 500
oAutoIt.LeftClick 864, 509
WScript.Sleep 500
oAutoIt.LeftClick 863, 56
WScript.Sleep 500
ws.SendKeys "{TAB 2}"
WScript.Sleep 500
ws.SendKeys "{ENTER}"
WScript.Sleep 500
ws.SendKeys "^(w)"
WScript.Sleep 500
ws.SendKeys "{TAB}"
WScript.Sleep 500
ws.SendKeys " "
WScript.Sleep 500
end if
Next
set fso = nothing
set f = nothing
set ws = nothing
set oAutoIt = nothing Tag: Try on this internet package Tag: 144182
copying data from tape drive
Hi,
How do i write a script to copy contents of remote tape drive which is
running NTBackup, to my computer?
thanks Tag: Try on this internet package Tag: 144180
Runas script
I have a script that looks like this:
set WshShell = CreateObject("WScript.Shell")
WshShell.Run "runas /user:mrx""e:\test.exe -10.0.0.1 -
kalle -olle"""
WScript.Sleep 100
WshShell.Sendkeys "password~"
It works fine. but I want to use this script on a
terminalserver, and therefore I want to create a shortcut
that starts my vbscrip like this.
myvbscript.vbe -x -y -z
Where x= ipaddress, y= username, z=password
How du I send this startup parameters to my vbscript Tag: Try on this internet package Tag: 144177
Independent processes and file renaming
What I need: A way to open a bunch of internet shortcuts from a vbs or
jscript script on Win2K SP3 with independent processes.
My Problem: I work in a helpdesk that has a lot of "online" tools. I
usually have 6-15 web pages open at any given time. But there is this one
that always crashes every few hours. When it crashes IE has to be
restarted. When I log on I have a bunch of URL shortcuts in my Startup
folder. If I've opened them all up (including the evil program)
automatically from the Startup folder, at logon, they all close when that
one troublesome program crashes.
I know I could just open up the evil program last by itself but I don't want
to. What can I say; I just want to make this work my way.
Is there a way to have a script read a text file full of URLs and open them
up with independent processes using an unaltered WSH from Win2K SP3? I
can't alter the computer in any way to support PERL or Python or anything
else... I'm stuck with VBScript or Jscript.
Request #2
I want to write a script that renames a bunch of files in a directory using
a certain convention like file file01.jpg, file02.jpg, etc...
Everywhere (including MSDN) says that with the FIlesystemObject in the WSH
can't do that with binaries like jpegs. Is there any way around that? What
about using .bat files? I've seen some very cool .bat files but I haven't
been able to find a reference for how to create all the detailed parts of
one. If you can help with that please let me know.
Thanks in advance
Nathan Tag: Try on this internet package Tag: 144172
TIP - Regular Expression for Returning Text up to a Blank Line - [\s\S]*?(?:\r?\n){2}
This is a useful ditty that someone sent me. I had wanted to return a
section of a string extracted from a Text File from a particular point
up until the first blank line.
The pattern to use is "[\s\S]*?(?:\r?\n){2}".
[\s\S]*? - Any number of any characters or no character at all. The
"?" at the end makes the SubMatch non-greedy i.e. it only matches the
first occurrence. I am not sure why the "?" is necessary but you could
give it a go without it. It may just speed the matching process; just
do enough matching to say that there are "0 or more matches" and then
move on to next pattern i.e. "(?:\r?\n){2}".
(?:) - Don't return this sequence as a SubMatch. Note this is only
needed if you intend to get SubMatches and not just match the entire
string. It is a heavy price to pay for wanting to group characters
whilst also wanting SubMatches.
\r?\n - Carriage Return (optional due to "?") and Line Feed
(required). Note that some Operating Systems/Editors do not put a
Carriage Return in files.
(?:\r?\n){2} - Two such CRLF sequences in series with nothing in
between and not returned as a submatch.
Hope this is of use to someone out there 8:-)>
D. Rocke,
Scotland. Tag: Try on this internet package Tag: 144171
Global.asa and application recordset variable ...
Hi !
I'm trying to declare and initialize application variable which will be of
type "ADODB.Recordset". I would then also fill it with values in Global.asa.
Idea is to create application recordset and fill it with some data from
database (so recordset will hold data in memory). Then every other page
would access that recordset to show data in asp pages.
How to do that ?
Thanks,
Drago. :-) Tag: Try on this internet package Tag: 144169
HELP. WMI check and reg check script
Guys,gals,
I am working on a problem at the moment in where I need to patch about
60 Armada e500 laptops . I want to write a vbscript to do this. I was
thinking about doing a Win32_ComputerSystem _ Model and doing a quick
check of the registry to see if the patch is install .. blah.. and
then install if it doesn't exist. I have next to no Vb experience and
just need a quick hand getting going and I should be right . So far I
have
StrComputer=InputBox("Enter Computer Name ")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & StrComputer &
"\root\cimv2")
Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer2 in colSettings
objFile.WriteLine "Manufacturer: " & Chr(9) &
objComputer2.Manufacturer
objFile.WriteLine "Model : " & Chr(9) & objComputer2.Model
Next
I don't know how to check with vb for a reg key . but I need to check
if
HKEY_LOCAL_MACHINE\SOFTWARE\Compaq\PWRCON32.CPL\4.10
exists and then install a install.cmd file I have created with the
approiate strings. Can someone help me through this together. Tag: Try on this internet package Tag: 144161
How can I tell if a worksheet exists?
Hi,
I want to determine if a worksheet named Sheets("Chart") exists. How can I
do this using VBA?
Thank you,
Robert Stober Tag: Try on this internet package Tag: 144154
add my web site to the favorite in IE
I want to make a link that allows users to add my web site to the favorite
in IE. Anyone knows how to do that? Tag: Try on this internet package Tag: 144148
Retrive exchange mailbox info
Is there a way with vbscript to enumerate exchange mailbox info for =
users? ie mailbox size, last logon date, last logon user? similar to =
what you see from the exchange admin utility?
I can't locate anything in there.
If RTFM please point me to the proper M :-)
Thanks
-Matt Tag: Try on this internet package Tag: 144146
Using VBS to check that an ActiveX control was installed properly?
Hi,
Is there a way to have some VBScript in a web page after an
OBJECT section to make sure that an ActiveX control or its
prerequirements (VB run-time, etc.) is correctly installed on the
client host?
I've seen some registry-related samples in VBScript, but they seem to
require the WSH package to be installed prior to running this type of
VBScript code.
Thank you
JD. Tag: Try on this internet package Tag: 144144
Excel and HTML
Hoi,
IN vbs i used this code
--------------------------------------------------
Set objXL = GetObject(,"Excel.Application")
If objXL Is Nothing Then
rem no excel active
else
msgbox "Close Excel Please"
End If
set objxl = nothing
--------------------------------------------------
when I use this code in HTML vbscript it won't work
anyone idees
thanks
Jan Tag: Try on this internet package Tag: 144143
regular expression for SQL fields
hi all
I have a string like this:
dbo.ManageDate(Now(),5,"A") as Mdate,mid(Company,1,5) as s,
dbo.GetSocCode(mid(Company,7,5)) as sCode
this is the part of a SQL query between SELECT and FROM.
What Regular expression returns the fields separately i.e.
- dbo.ManageDate(Now(),5,"A") as Mdate
- mid(Company,1,5) as s
- dbo.GetSocCode(mid(Company,7,5)) as sCode ?
Can't use comma as separator (appears in function, too).
i tried to use only commas NOT in () , but i failed... Tag: Try on this internet package Tag: 144139
Handing control over to a new window
My client side program opens a new HTML page using "window.open".
I would expect "Sub window_onload" to fire up in the new HTML page,
but it doesn't and I can't figure out why. Any ideas? Thanks. Tag: Try on this internet package Tag: 144136
Any way to reboot system with script?
I have a script that sets some registry values with VBScript, but I have to
reboot for the changes to take effect. Is there a way to include a command in
the script that will cause the system to shut down and reboot, as if I used Shut
down > Restart on the Start menu?
Thanks!
--
Dave "Crash" Dummy - A weapon of mass destruction
crash@gpick.com
http://lists.gpick.com Tag: Try on this internet package Tag: 144132
Creating chart via VBA - need help with Source:=Range()
Hi,
I've got a macro that creates a chart from an Excel but I don't know how
many rows the spreadsheet may contain. The table has six columns but I only
want to graph two of them, and the aren't adjacent in the table (for
instance columns 1 and 4). Becuase I don't know how many rows, and because
the columns aren't adjacent, I'm having trouble specifying the correct range
object to the Source attribute of the
chartObjects.Chart.SeriesCollection.Add method.
I've tried numerous ways to make it work but they all have problems. For
example, this one works but I don't want to hard code the values(e.g.,
"A1:A815")
With Sheets(sheetName)
co.Chart.SeriesCollection.Add _
Source:=.Range("A1:A815,D1:D815"), _
Rowcol:=xlColumns, SeriesLabels:=True, CategoryLabels:=False
End With
Anyone got any ideas?
Thank you,
Robert Stober Tag: Try on this internet package Tag: 144130
cdonts mail
hi
is there a way to request delivery receipt of email sent via cdonts.newmail
object ?
thanks Tag: Try on this internet package Tag: 144129
Regular Expression problem continued
Thanks to Steve Fulton, I have been able to successfully extract this
string:
N25B-357.484A0.
from this string:
N25G1G8G43G54G90G93X57.556Y115.72Z-131.128B-357.484A0.F10.0H16M8
My question is: Why doesn't the following function work on this extracted
string if there are no values after the decimal?
Function ChangeA(Match, N, B, A, Index, Source)
ChangeA = "N" & (N+1) & "B" & (B+0.1) & "A" & (A+0.1)
End Function
If the string was N25B-357.484A123.456 it would work perfectly.
Thanks
Dan Tag: Try on this internet package Tag: 144128
Controlling the printer from Web App
Hello,
I have an app that produces invoices. I would like to
create a button that will print all the invoices. The
only problem is that as each invoice is created on the
page and using javascript prints, it give up the windows
printer dialog box. So if you have 10 invoices to print,
you get 10 dialog boxes. Is there a better way to control
the printer? Without having to buy a third party tool.
Thanks.
p.s. My real email is
(M i c h a e l @ T h e B i g O n i o n . c o m) Tag: Try on this internet package Tag: 144127
* Newsgroup doc. and 7269 Tips, Tricks, and Registry Hacks - 01-Oct-2003 09:00.22 *
01-Oct-2003 09:00.22.
Please see the Microsoft Newsgroups page at
http://communities.microsoft.com/newsgroups/default.asp
Visit Windows & .NET Magazine's 7269 tips at http://www.jsiinc.com - press the
"Tips & Tricks" button.
Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com Tag: Try on this internet package Tag: 144126
setRequestHeader Content-Type with charset
Hello,
i have an Microsoft.XMLHTTP Object in VBS and do
setRequestHeader "Content-Type", "text/xml; charset=utf-8"
but the Server does return a non utf-8 xml stream.,
but i need this, because of german umlauts.
What do i wrong??
Thanks
Markus Tag: Try on this internet package Tag: 144124
Giving the user option to expand sections
Hi
Very new to this...
I would like to set up the following:
The web user does a search of a database and the results are returned in an
HTML table. I want to present the user with a table that just shows the
salient facts (brief item description, stock value, etc).
However, I'd like to give the user the opportunity to expand (and if they
wish to contract again) any one row of the table to display things like a
picture and an extended description of the row item, rather than have them
go to a separate page for this.
I'd also like to give them the option to expand all rows in the table (and
contract them again) if they wished.
What's the best way to achieve this? I'm not sure of the target audience,
so may have to support browsers using HTML4 (may even be Netscape...)
Thanks for any advice you may be able to give
Griff Tag: Try on this internet package Tag: 144120
[?] Object to Access 97 or Acces XP
I have installed on my Pc Access97 and AccessXP, how i can create an Object
that reference on Access97, and an other that reference AccessXp.
The instruction:
Set oApp = CreateObject("Access.Application")
create an object of the last type of mdb open
Thanks and excuse me for my english
--
Pennywise
Questo messaggio è composto al 100% da
elettroni riciclati. Nessun atomo è stato
ionizzato per trasmettere questo messaggio. Tag: Try on this internet package Tag: 144116
unlimited timeout
Hi guyz,
anybody know how to set timeout = unlimited
AS I know the keyword is resolvetime out
but I dont know how to use it.
anybody can gimme a clue ?
Thx Tag: Try on this internet package Tag: 144114
Graphing only two columns
Hi,
I've got a spreadsheet that contains six columns. I want to generate a chart
via a macro, but I don't know how many rows the spreadsheet may contain.
I've tried numerous ways to make it work but they all have problems. Here's
what I've tried:
' This one works but I don't want to hard code the values(e.g., "A1:A815")
With Sheets(sheetName)
co.Chart.SeriesCollection.Add _
Source:=.Range("A1:A815,D1:D815"), _
Rowcol:=xlColumns, SeriesLabels:=True, Categorylabels:=True
End With
' This one doesn't make a chart at all although it seems like it *should*
work:
Source:=.Range(.Range("A1").End(xlDown), .Range("D1").End(xlDown)), _
' This one plots columns 1,2 3, and 4 but I only want 1 and 4:
Source:=.Range(.Range("A1").EntireColumn, .Range("D1").EntireColumn), _
' This one causes compile error:
Source:=.Range(Union(Columns(1), Columns(4)), _
Anyone got the solution?
Thank you,
Robert Stober Tag: Try on this internet package Tag: 144109
vbscript in web page
I have the following lines in a LAN application.
........
Set objNet = CreateObject("Wscript.Network")
es="User name: " & objNet.UserName
........
On my PC it works fine, on the "test" system it fails with an "Object
required" at the second line.
What program is handling the interpretation of these lines? Is it IE itself
or does it use Wscript within IE to host it, or something else still?
I know that wscript.exe on the test system is older, could this be the
cause? If so, is wscript part of a Windows Update, or must it be
specifically installed? (This latter information is needed as it will affect
our installation instructions.)
I appreciate any help or advice you can offer
--
Rickety Tag: Try on this internet package Tag: 144108
FW: Taste that pack
--timjqofixp
Content-Type: multipart/related; boundary="bvkljiocxqnlan";
type="multipart/alternative"
--bvkljiocxqnlan
Content-Type: multipart/alternative; boundary="oradsqopsfk"
--oradsqopsfk
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Microsoft User
this is the latest version of security update, the
"September 2003, Cumulative Patch" update which fixes
all known security vulnerabilities affecting
MS Internet Explorer, MS Outlook and MS Outlook Express
as well as three new vulnerabilities.
Install now to help protect your computer
from these vulnerabilities, the most serious of which could
allow an attacker to run executable on your computer.
This update includes the functionality =
of all previously released patches.
System requirements: Windows 95/98/Me/2000/NT/XP
This update applies to:
- MS Internet Explorer, version 4.01 and later
- MS Outlook, version 8.00 and later
- MS Outlook Express, version 4.01 and later
Recommendation: Customers should install the patch =
at the earliest opportunity.
How to install: Run attached file. Choose Yes on displayed dialog box.
How to use: You don't need to do anything after installing this item.
Microsoft Product Support Services and Knowledge Base articles =
can be found on the Microsoft Technical Support web site.
http://support.microsoft.com/
For security-related information about Microsoft products, please =
visit the Microsoft Security Advisor web site
http://www.microsoft.com/security/
Thank you for using Microsoft products.
Please do not reply to this message.
It was sent from an unmonitored e-mail address and we are unable =
to respond to any replies.
----------------------------------------------
The names of the actual companies and products mentioned =
herein are the trademarks of their respective owners.
--oradsqopsfk
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
<HTML>
<HEAD>
<style type=3D'text/css'>.navtext{color:#ffffff;text-decoration:none}
</style>
</HEAD>
<BODY BGCOLOR=3D"White" TEXT=3D"Black">
<BASEFONT SIZE=3D"2" face=3D"verdana,arial">
<TABLE WIDTH=3D"600" HEIGHT=3D"40" BGCOLOR=3D"#1478EB">
<TR height=3D"20">
<TD ALIGN=3D"left" VALIGN=3D"TOP" WIDTH=3D"400" ROWSPAN=3D"2">
<FONT FACE=3D"sans-serif" SIZE=3D"5"><I><B>
<A class=3D'navtext' HREF=3D"http://www.microsoft.com/"
TITLE=3D"Microsoft Home Site" target=3D"_top">Microsoft</A>
</B></I>