VB logon script
I have a logon script for all my users. Some times I have users that complain
that not all the shared drives are connected, I also have 2 or 3 users that
the user drive will not map at logon time. Everything will map fine if i run
the script manually from their desktop.
I made sure they have the latest updates, I also checked for any CRC errors,
or latencies problems, but everything was fine.
Can some one give me a clue to where i should start looking for problems?
Thanks Tag: P3P web site integration Tag: 192233
VB startup printer script.
Hello,
I'm trying to create a startup script for WinXP workstations via Win 2003
server. I have the VB script for adding printers and can run them
successfuly when running directly on the workstation. However, when I assing
the script via GPO in Active Directory as a startup script, the script does
not run. Upon starting up, the machine shows "startup scripts," but once I'm
logged on no printers appear. I have de-activated Windows Firewall in hopes
that that was the culprit, to no avail. Any help here will be greatly
appreciated.
Thanks in advance,
Vince Tag: P3P web site integration Tag: 192231
Problems in Waiting for Web page to Open
Hi
Inexperienced scripter building a small vbs script to allow hotkey
combo launching of a virus scanner that, without the script, would
require "mouse-clicking" through four different pages before the
scanner will start.
The script starts by launching IE and then calling the virus scanner
Start Page, waiting until the page is fully open, tabbing (via
SendKeys)to the appropriate button and Entering (via SendKeys).
The "waiting" in this step is done via:
While IE.ReadyState <> READYSTATE_COMPLETE : Wscript.Sleep tDoEvents
Wend
This brings up a EULA page where I would have liked to have used the
same While....Wend loop to wait until the page was fully open before
using the SendKeys function to "click" the Accept button and move to
the next page. However, use of the While....Wend loop causes the script
to stop and go no further. To overcome this, I have used instead a
Sleep command (WScript.Sleep 5000) whereupon it proceeds without
difficulty.
In the subsequent page, the scanner downloads updates for a time that
is quite variable depending chiefly on the days since the last update.
Once again, the While....Wend loop causes the script to stop while a 25
second Sleep, in its place, overcomes this problem in a somewhat
inelegant manner as perhaps as little as 2 seconds are necessary to
download the updates.
The final page allows choice of what is to be scanned. Here the
While....Wend loop works fine.
Although the script does what it is supposed to do, I`m puzzled as to
why the While....Wend loop works in only two of the four attempts to
incorporate it in this "macro".
Can anybody suggest what might be the problem here?
TIA
Paul Tag: P3P web site integration Tag: 192229
Script needed to search for long filenames
Hi,
Does anyone have a script that will search a drive (and all subfolders) and
output (to a text file) a list of all files that exceed a specified number
of characters, including their full path?
Thanks,
Curtis.
--
Please reply to news group only. Thank you. Tag: P3P web site integration Tag: 192225
copying files to a drive mapped to a machine on the network
Hi,
I am trying to use Copyfile method of the file sytem object (FSO) to
copy files on my IIS box to another machine on the network. On my IIS
box I have a drive(l:) mapped to the other machine on the network
I use the following code
Object.CopyFile "d:\myfiles\*.*","l:\myfiles"
Will this work. The drive l: is mapped on the IIS box to another machine
on the network. The drive d: is the local drive on the IIS box.
Also after copying if I want to show a file (for example a word
document,photo) on the "l:\myfiles folder" in my asp pages can it be
done.
THanks.
Kumar.
Thanks.
*** Sent via Developersdex http://www.developersdex.com *** Tag: P3P web site integration Tag: 192224
RegExp advice please
Greetings:
I have a load of data that I need to alter. I am using the RegExp
object inside a SQL Server DTS Task. The data had links that were
designated in a very proprietary way, and I need to convert these to
HTML hyperlinks. Here are some examples the proprietary links:
[[link text| IMAGE v:\bitmaps\image18.bmp CLIP]]
[[more link text | IMAGE v:\bitmaps\link8.bmp CLIP]]
[[link| IMAGE v:\bitmaps\foonugget\d01.bmp]]
Here is the search I use:
\[\[(.+?)\|\s+IMAGE+\s+.{3}([^\s\]]+)[^\]]*\]\]
And here is the replace:
<A HREF=http://server.mydomain.com/\2>\1</A>
It works and gives me:
<A HREF=http://server.mydomain.com/bitmaps\foonugget\d01.bmp>link</A>
My issue is that I am unsure how to change the backslashes to forward
slashes. As the path may contain one or more subdirectories, I cannot
count on a specific number of tokens.
I had hoped that I could perform a Replace on individual matches in the
SubMatches collection, but it appears to be read-only.
If anyone has any advice, I would REALLY appreciate it.
Thanks,
Corky Tag: P3P web site integration Tag: 192222
Enumerate local group members with domain information
Sometimes I've seen topics where people needs domain information and
object name when enumerating local groups. Here is short script for
that... Use the Replace function if the string WinNT:// bothers you.
But it's usefull if you add/remove objects to/from the group.
********************************************************************************************************
********************************************************************************************************
Set oNet = WScript.CreateObject("WScript.Network")
set objGroup = GetObject("WinNT://"& oNet.ComputerName &
"/Administrators")
For Each objUser in objGroup.Members
MsgBox(objUser.AdsPath)
Next
MsgBox("Done.")
********************************************************************************************************
********************************************************************************************************
If you like to remove something...
If objUser.Class = "User" Then
oGrp.Remove objUser.AdsPath,user
End If
If objUser.Class = "Group" Then
oGrp.Remove objUser.AdsPath,group
End If
********************************************************************************************************
Br,
Miika Tag: P3P web site integration Tag: 192214
Converting object to string
Hi,
I have the following code to get the folder path:
Set oFileSystem =Server.CreateObject("Scripting.FileSystemObject")
Set tfolder = oFileSystem.GetSpecialFolder(2)
Response.Write(tfolder) will display as C:\windows\Temp
Now I need to get a substring of this result. I cannot use any string
functions as it is giving an error.
Any ideas?
Thanks,
Anishya Tag: P3P web site integration Tag: 192212
Reading each word of a file, line by line
Hi all,
* Here is the content of the file I want to modify via vbs :
project version release
a b c
* What I wish to obtain at the end is :
set project = a
set version = b
set release = c
Many thanks in advance for your help.
Regards Tag: P3P web site integration Tag: 192202
Listview/HTA help please.
I'm trying to use a listview object in an hta.
I can create the object and populate/display data in the object.
What I don't know how to do is attach a function or sub to the object
events "click", "columnclick" etc..
The pages on MSDN are really lite on the control, I've done everything
so far just using an objbrowser for doc
Any help and all help welcomed and apprieciated.
Thanks in advance,
Regards T.Olsen.
ps. I'm looking to do columnclick so I can sort, if there is a sample
someplace I'm interested in seeing it. Tag: P3P web site integration Tag: 192200
CSng adds erroneous digits to the value
I'm stumped with what's happening here. I have a value in a CSV that I
want to round. I wanted to use CSng to force the single data type so
that an error would not occur from trying to round a text string. My
code is simple:
Cells(i, 8).Value = Round(CSng(Cells(i, 10).Value, 4))
where i is an integer used in a loop to run down the cells in columns 8
and 10.
For some reason when I set the value in Cell(i,8), Excel is adding some
apparently random erroneous digits to the end of the value. So for
example, a value appearing as 12.1294 in Cell(i,10) comes out as
12.12946789 in Cell(i,8). It appears to be something that happens when
I insert the value into a cell too. If I just display
Round(CSng(Cells(i, 10).Value, 4))
in a Msgbox everything looks fine. Anybody know what might be causing
this? I'm running MS VB 6.0 with MS Excel 2000. Tag: P3P web site integration Tag: 192196
directories permition enumeration ?
hello there
any body with a script to view folders and files permissions in windows ?
I need to write a script to give me a report on who has what on what
file/directory in a drive.
Thanks Tag: P3P web site integration Tag: 192195
Script writing Training
I am looking to do a lot of scritpt writing training on my one. I have found
Don Jones training at
http://www.scriptingoutpost.com/category.aspx?categoryID=3 as was looking for
comments.
I am wanting to start with some type of classroom training without having to
sit in the class all day. More of an hour a day type of thing...
Any thought? Tag: P3P web site integration Tag: 192192
Help Needed Please -- input function and using the input
Ok so here's teh deal i am totally new to scripting but managed to
create a script in which a prograame called pslist(a tool to log
process data) runs from a locotion on the drive and also checks a file.
This script works fine but only on local system and for local
processes.
I included in the script an input box for user to input the ip address
of the remote machine.
But i dunno how to use this Input data within my script to run pslist
with the remote machine switch.
The code is below, Please any help would be really great.
Option Explicit
Dim objFSO,Input
Dim objShell,strSysDrive
Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strSysDrive = objShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%")
If objFSO.FileExists (strSysDrive & "\testfolder\ps.txt") Then
Wscript.Echo "Change the name of PSLIST log files before running
another test"
Wscript.Quit
Else
Input = InputBox("Enter the IP Address or the name of the remote
server")
objShell.Run "%comspec% /T:2E /k %systemdrive%\testfolder\pslist.exe
pslist -s \\ "
objShell.Run "%comspec% /T:2E /k %systemdrive%\testfolder\pslist.exe
pslist -s >>%systemdrive%\RMQCA\ps.txt"
End If
Input = InputBox("Enter the IP Address or the name of the remote
server")--->> this is what will give the user to fill in the ip
address.
objShell.Run "%comspec% /T:2E /k %systemdrive%\testfolder\pslist.exe
pslist -s \\ --->> this is where i need that ipaddress to be so that i
can run pslist like :
pslist -s \\ipaddress
I hope i explained what i am after. Thank you all once again Tag: P3P web site integration Tag: 192186
format time as 24 hour time
Does anyone know an easy way to format a time string in a 24 hour clock
setting (no AM/PM) in classic ASP ?
i.e.
HH:MM:SS
vbscript/asp doesn't support the Format statement, and FormatDateTime(Now(),
vbShortTime) will only give HH:MM
I really don't want to have to create vb dll just for this....
Thanks,
Mike Tag: P3P web site integration Tag: 192177
Help with script
I have a script that I am using that will change the users password based on
a list from a text file, I am also adding notes in the "Info" field in AD,
the questions I have is how can I append to the current info that is in
there. When I run the script it will replace what ever information is in
there. This is what is running against the users account. I want to append
to this not replace what is there already...
Thanks
Gavin...
objUser.Put "Info", "Password changed on 06/06/2006 by Tech Services"
On Error Resume Next
objUser.SetInfo Tag: P3P web site integration Tag: 192167
script auditing for a specific folder
Hi all,
I need to modify 500 users winnt ( and a couple of others) folder to
enable auditing for Everyone and set it to fail for full control. I
also need to enable this to propagate down to all files and folders.
Finally, this needs to be done on winxp and 2000. I've been search the
group but have come up empty. Surely there's got to be some way to
script this out. Thanks in advance for ANY help. Tag: P3P web site integration Tag: 192166
wsharguments length limit?
Getting a little closer to having this working (thanks for the previous
ideas!)
I now find that if I pass in my second argument to this code:
Option Explicit
Dim objArgs
Set objArgs = WScript.Arguments
Sub CallExcelMacro(strPath, strEName, strMacro)
Dim objXL
Set objXL = WScript.CreateObject("Excel.Application")
objXL.WorkBooks.Open strPath & strEName
objXL.Visible = FALSE
objXL.Run(strMacro)
objXL.Quit
Set objXL = Nothing
End Sub
Call CallExcelMacro(objArgs(0), objArgs(1), objArgs(2))
so that it's longer than 15 characters, then the script won't run.
Ironically, the strPath variable is longer and doesn't seem to cause any
problem. (So maybe it's something else?)
The code that works (by renaming my spreadsheet to accomodate, which isn't a
long term option) from my other (SAS) program that calls this is:
rc = system('cscript.exe //nologo
"\\inlrc11\abc\mets\general\CallExcelMacro.vbs"
"\\inlrc11\abc\temp\state excel\"
"ST Weekly 70170.xls"
"LoadData"');
(The system function basically calls cscript in command line fashion.)
However, the following bombs:
rc = system('cscript.exe //nologo
"\\inlrc11\abc\mets\general\CallExcelMacro.vbs"
"\\inlrc11\abc\temp\state excel\"
"ST Weekly 701709738.xls"
"LoadData"');
Any thoughts on why the longer Excel filename causes this to bomb? Probably
something dumb I'm doing, but this isn't my main language. Again, many
thanks! Tag: P3P web site integration Tag: 192165
Can VBS read an environment variable?
We have a vbs script that has hardcoded a destination folder, including
drive letter. Unfortunately, our servers sometimes have the destination on
the C: drive and others may, for example, be on an F: drive. I am thinking
the way to generalize the script would be to set a global environment
variable and instead of hardcoding the drive, substitute the environment
variable value instead.
Does anyone know if this is doable? Tag: P3P web site integration Tag: 192163
getting error error '80072116'
Hi all,
I'm trying to convert a vbscript that unlocks domain user accounts from
vbscript to asp
there is a particular portion of the code, see below, that fails with
error error '80072116' :
I'm running this code on a windows 2003 domain.
Any help would be very much appreciated !
Thanks in advance.
' Convert user NT name to Distinguished Name.
--> THIS FAILS --> objTrans.Set ADS_NAME_TYPE_NT4, strNetBIOSDomain &
"\" & strUserNTName
If Err.Number <> 0 Then
On Error GoTo 0
Response.Write "User " & strUserNTName & " not found"
Response.End
End If
On Error GoTo 0
strUserDN = objTrans.Get(ADS_NAME_TYPE_1779) Tag: P3P web site integration Tag: 192159
Can't use string in request.form
Any one see whats wrong with this? How can I get around it
echo "REAL " & aryImf(CDC_FIELD,intFields) & "<BR>"
echo "STRING " & Request.Form(aryImf(CDC_FIELD,intFields)) & "<BR>"
My output says
REAL imf_origin
STRING Tag: P3P web site integration Tag: 192158
Running script as a service fails to write file
I have a VBScript that is run as a Windows service. It works fine
except for the fact that an output file I write does not get created or
written to. If I run the same script manually (not as a service) the
file is written correctly.
The service is running as the localsystem account with interact with
desktop enabled.
Any thoughts on why the file does not get created?
TIA Tag: P3P web site integration Tag: 192157
running object table
I want to create an application launch button within a running application
but want to launch a new instance only if an existing instance of the program
is not running. Both applications are Web apps so just understanding if I.E.
is running is not enough. Any suggestions/samples would be appreciated. Tag: P3P web site integration Tag: 192155
Script to know default printer
Hi all,
I need to know who print conection is the deafult in use ?? how can know
this???
anybody can help me??
thanks in advance
Daniel Tag: P3P web site integration Tag: 192154
Need help filtering /querying specific text from large text /log file
Hi everyone
I need a script to pull only a small part of text from each line in my
log file with 2000 plus lines. each line contains various web trending
data, ip address, url etc. i need to pull specific part of each line
from the text file/log and put it in its own output.txt file. each
line has a url with various pdf file name at the end need to pull only
the text after the url section example (
www.blahblah.com/salestools/bysn-6lydea_ro_en.pdf) I need only the
info after salestools/ and before .pdf put into its own output
file. Because there are over a hundred pdf names i need this to be a
wildcard. if possible i need to group them as well, (put similar
/same text names in their own colum or group in the output file.)
any ideas? Tag: P3P web site integration Tag: 192147
How can I follow a trail of 302 redirects with MSXML2.XMLHTTP?
Hi all ...
I have an interesting one here. I have some code that I've been using
for years to pull down HTTP content as needed. However, I've just run
into a situation that I've never seen before, and can't quite figure a
way around ...
Background: If a URL fed to MSXML2.XMLHTTP via VBScript returns a 302
"redirect" when loaded - VBScript will crap out on the page load due to
security settings in IE, if the redirected URL is in another domain.
You won't get any content back as a part of the response, and the HTTP
status code actually comes back as "0". However ... if you enable the
"Access data sources across domains" option in the security settings
for IE - the MSXML2.XMLHTTP control will follow the 302 path and
eventually get the final result page and return the contents to you.
(/RANT-ON ... I shouldn't have to change settings in IE to control
how my VBScript program will work! Ugh! /RANT-OFF)
However, I would like to detect this 302 activity and track it from the
starting page to the ending page. For instance, here's WGET tracking a
two-layer redirect from a Feedburner link that demonstrates the
situation:
1. WGET http://feeds.geffen.com/artist/robzombie/content?m=145
HTTP request sent, awaiting response... 302 Moved Temporarily
Location:
http://feeds.feedburner.com/~r/artist/robzombie/content/~0/145
[following]
2. WGET http://feeds.feedburner.com/~r/artist/robzombie/content/~0/145
HTTP request sent, awaiting response... 302 Moved Temporarily
Location:
http://www.geffen.com/artist/news/default.aspx/nid/8031/aid/414/?utm_s
ource=rss&utm_campaign=rss&utm_medium=News&utm_content=nid_8031
[following]
3. WGET
http://www.geffen.com/artist/news/default.aspx/nid/8031/aid/414/?u
tm_source=rss&utm_campaign=rss&utm_medium=News&utm_content=nid_8031
Resolving www.geffen.com... 192.251.67.164
Connecting to www.geffen.com|192.251.67.164|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8,294 (8.1K) [text/html]
Here's some code I put together, to try to loop through each redirect
until a final non-302 result is returned ... and state what the final
link was. But I can't seem to find any way to get this concept to work
based on what MSXML2.XMLHTTP provides me, given its interaction with
Internet Explorer. Basically, if I enable the "Access data sources
across domains" the control will simply follow the 302's and not tell
me about it, and return the final page but with a link that
(technically) doesn't match. If I disable the option, the GET
performed by XMLHTTP craps out, returns a 0 result code.
Any thoughts on a way to accomplish this? Is it even possible, or am I
trying to do something that is completely outside of the control
provided by MS?
Thanks in advance ...
Const READYSTATE_UNINITIALIZED = 0, _
READYSTATE_INITIALIZED = 1, _
READYSTATE_LOADED = 2, _
READYSTATE_INTERACTIVE = 3, _
READYSTATE_COMPLETE = 4
MaxLoadTime = 20
MaxLoops = 10
url = "http://feeds.geffen.com/artist/robzombie/content?m=145"
StatusResult = 302
LoopCount = 0
wscript.echo "START: " & url
Do while loopcount < maxloops and statusresult = 302
loopcount = loopcount + 1
CheckPageLoadTime = 0
PageLoadStartTime = now()
Set objHTTP = CreateObject("MSXML2.XMLHTTP.3.0")
Call objHTTP.Open("GET", url, TRUE)
objHTTP.Send
Do Until objHTTP.ReadyState = READYSTATE_COMPLETE or CheckPageLoadTime
> MaxLoadTime
wscript.sleep 100
PageLoadEndTime = now()
CheckPageLoadTime = DateDiff("s", PageLoadStartTime, PageLoadEndTime)
Loop
HTTPGET = objHTTP.ResponseText
StatusResult = objHTTP.Status
HTTPRedirectLocation = objHTTP.GetResponseHeader("Location")
If CheckPageLoadTime > MaxLoadTime then
wscript.echo "TIMEOUT"
end if
IF StatusResult = 302 then
wscript.echo "REDIRECT: " & HTTPRedirectLocation
url = HTTPRedirectionLocation
end if
loop
wscript.echo "END: " & url
wscript.echo
wscript.echo "HTTP Status: " & StatusResult
wscript.echo "Redirects: " & loopcount
Here's my results with the security option set to disabled:
START: http://feeds.geffen.com/artist/robzombie/content?m=145
END: http://feeds.geffen.com/artist/robzombie/content?m=145
HTTP Status: 0
Redirects: 10
And here's my result with the security option set to enabled:
START: http://feeds.geffen.com/artist/robzombie/content?m=145
END: http://feeds.geffen.com/artist/robzombie/content?m=145
HTTP Status: 200
Redirects: 1
So, to me, it seems as though it is possible to trace the string of
302's through the MSXML2.XMLHTTP control??
Thanks in advance.... Tag: P3P web site integration Tag: 192146
Passing parameters from command line
Hopefully this is pretty simple and I'm just not seeing it in my book. I
have a vbs script that calls Excel and runs a macro. I would like to
generalize it so that I can pass in the path to any spreadsheet, the name of
the spreadsheet and the macro to run. I can write a sub to do it and then
call the sub, but because of another language involved in this process, for
it to work I need to be able to call the script via command line and pass the
parameters that way.
Any help would be greatly appreciated. Thanks Tag: P3P web site integration Tag: 192144
export startup and shutdown times to file
Hello, I'm very new to scripting and am looking for help, as general or
specific as you care to provide. I want a script that would be run at
computer startup and computer shutdown to record the computer name and time
of the event to text/database/excel/e-mail (I don't care which right now)
file. This wouldn't be the same as reading the event log, as getting
updates from the event log would require the computer to be on.
The general point is that we have users that often spend months away from
the office, and we have no idea who they are or when this occurs. If their
computers are not on, the WSUS server and HFNETCHECK cannot update them. If
I have a way of seeing which machines are off for extended times, we can turn
them on and manually update them.
We would place these scripts in the startup/shutdown area of Group Policy.
Thanks for any ideas. Tag: P3P web site integration Tag: 192141
Trouble conting.. script out of range
I'm not sure why, but it seems pretty random. I am getting script out of
range here and there. Here is the part im having trouble with now.
Const ARY_ROWS = 2
Const CDC_FIELD= 0
Dim iRow
For iRow = 0 to Ubound(aryImf,ARY_ROWS)
echo iRow
If aryImf(iRow,CDC_FIELD) = strField Then
My output looks like this: (and I don't know why 0 shows 3 times before
the 1).
0001
Microsoft VBScript runtime error '800a0009'
Subscript out of range: 'iRow' Tag: P3P web site integration Tag: 192140
input type = "File" in an HTA
Hi,
I have written a script to do an inventory of servers in my domain. I
have been asked to revise the script so that it will take a list of
servers from a text file and process them one at a time.
I tried to use the following input in my HTA;
<p align="center"><font size="4"> Enter Server Text File Here: <input
type="File" name="Stxt" Size="40"></p>
The problem is that it only pulls the file name and NOT the full path,
so I get a file not found error when I run my script. Is ther a way to
get the full path and file name to return from this method?
<-------------------------Code snip
------------------------------------>
If Trim(Stxt.value) <> " " Then
cList = Trim(Stxt.value)
statval.value = statval.value & " " & cList
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("cList", ForReading)
Do Until objTextFile.AtEndOfStream
<----------------------------End Snip
------------------------------------->
OldDog Tag: P3P web site integration Tag: 192137
TRANSFORM/pivot table in VBS
code:
'-----------------------------------------------
Set objConnection = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & str_BaseGetPath & ";" & _
"Extended Properties=""text;HDR=NO;FMT=Delimited"""
'"TRANSFORM Count(tlnk_Fact.Field2) SELECT tlnk_Fact.Field1 AS
District, Count(tlnk_Fact.Field2) AS [Total Count] FROM " & file_Names
& " GROUP BY tlnk_Fact.Field1 PIVOT tlnk_Fact.Field4;"
str_SQL = "TRANSFORM Count(tlnkFact(1)) SELECT tlnkFact(0) AS District,
Count(tlnkFact(1)) AS [Total Count] FROM " & _
file_Names & " as tlnkFact GROUP BY tlnkFact(0) PIVOT tlnkFact(3);"
rs.Open str_SQL, objConnection, adOpenStatic, adLockOptimistic,
adCmdText
'-----------------------------------------------
returns a "undefined function [tlnkFact]" error.
What am I doing wrong? the following works
str_SQL = "Select * from " & file_Names Tag: P3P web site integration Tag: 192130
VB MACRO for Publishing the files
Hi,
Im new to scripting
For a project implementation i need VB MACRO to do the following task.
The core idea is to Publish the pdf files from one drive to an another
dirve to respective user folder for the following scenerio.
Lets start ...
A database table "User" have three columns
REPORT --> it has the pdf file names
USER ---> it has the user name
& STATUS --> it has status whether the file has been published
succssfully
We have the folder in drive H: ( this contains pdf files as in
modulewise, say three modules)
a) ACR
b) ACR-ALL
c) ACR-Netdebit
Each folder contains various pdf's files
On the other hand drive G: ( it contains user names in folder wise)
i have to create various folder on user names(like john, smith, ..)
these folders should be created by refering that "User" table .
Now the core task is to take the pdf from H: to publish in G: on
respective user folder that even inside date folder. ( let say today's
date is june 6, 2006) the folder struture should be like this
2006-->june-->06
Also for every month folder we need create date folder(say 1st june to
30th june).
Also we need to update the status on the table sucess or failure.
I need the Macro vbscript (code) to acheive this.
Pls help me in this regard.
Im eagerly waiting for your response.. this will help me lot..
Thanks in advance.
Thanks & Regards,
_______________
Moulee Tag: P3P web site integration Tag: 192122
Copying a file in a series of directories
Hi all,
Situation :
* Windows 2000 Domain
* All home directories are gathered in
\\DomainServer\Home_Directories (approx 200 dir)
What I need to do is to copy one configuration file into each home
directories contained in "\\DomainServer\Home_Directories".
What is the easiest way to achieve this?
I am an utter noob in wsh/vbs/bat scripting....so thank you in advance
for helping.
Regards Tag: P3P web site integration Tag: 192121
Desktop VB Script
Does anyone know how I can get a classic desktop and arrange the icons for
all users via a vb script?
--
««««««««««««««««««««««««««««««««
Todd Gregory
Citrix Certified Administrator
Professional Teledata
175 Canal Street
Manchester, NH 03101
phone 800.344.9944
fax 603.625.5078
t.gregory@proteledata.com
Visit our web site www.proteledata.com
»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»» Tag: P3P web site integration Tag: 192120
query computer name
I'm a freshman to vbscript, i write a script to query computer name by
ip address as list:
strcomputer = "192.168.0.1"
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
strComputer & "\root\default:StdRegProv" )
' obtain computer name
strKeyPath =
"SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\"
strEntryName = "ComputerName"
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath & SubKey
,strEntryName,strHostName
Wscript.Echo strHostName
it always return the error of type mismatch, can somebody help me
check what's wrong with this script? thanks in advance!
--
fale
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------ Tag: P3P web site integration Tag: 192114
how to run a vbscript from windows service
in the ws i have a client which on start starts an appln exe which in
turn calls a vbscript to establish the connection..
when the appln exe is made to run separate the vbscript runs fine..
when it is made to start from the client as the appl exe depends on
this client it says cannot create object to establish connection..but i
am sure i have access rights..
the vb script has set obj=createobject("servicename","ipaddress") Tag: P3P web site integration Tag: 192113
Reg Password Complexity for a local account
Hi,
Could anyone plz let me know how to obtain the password complexity for
a local user.
My code is as follows:
Set objDomain = GetObject("WINNT://INGBTCPIC5dt440/localUser)
intPwdProperties = objDomain.Get("PwdProperties") // There is no such
property.
WScript.echo "pwdProperties = " & intPwdProperties
For Each Key In objHash.Keys
If objHash(Key) And intPwdProperties Then
WScript.Echo Key & " is enabled"
Else
WScript.Echo Key & " is disabled"
End If
Next
This code will not work as the proprerty "PwdProperties" is not found
for local user.Is there
any other way to obtain the password complexity?
Thanks & Regards.
Sharan Tag: P3P web site integration Tag: 192110
How to Use ActiveX for Client PC using ASP
Hi Friends,
I have created one ActiveX DLL in VB that has one public function
("GetClientCPUID") which will return a string of the CPUID. I want to use
this to get the clients CPUID and retuern to webserver. I am new to using
activeX in client side.
In Asp how can I send this ActiveX to client browser? (I will instruct my
users to allow this activeX). Is there a way I will execute this activeX in
clients PC and get the return value and return to the server for my
processing? Please suggest the ways that I can do this.
Also suggest what are the situations that I should know before I proceed. I
think there will might a issue when I upgrade the activeX and the client
those are using the current one may face problem so I think I will need a
way to uninstall the register the new one. I am not sure of this. Please
suggest.
Thanks
Prabhat Tag: P3P web site integration Tag: 192108
Browsing for Files
I'm looking for a handy way for a vbscript to display a file browse dialog
box.
One method I've seen discussed is to use the Shell.Application
BrowseForFolder method with a flag that tells it to also browse for files.
E.g.
Const BIF_browseincludefiles = &H4000
Set ShellApp = CreateObject("Shell.Application")
Set Ret = ShellApp.BrowseForFolder(0, "Choose file.",
BIF_browseincludefiles)
In practice, however, this code generates the error "The system cannot find
the file specified" on my XP and 2003 systems.
Is there some kind of workaround to prevent this error? Thanks,
--
Joseph Morales
[To reply directly, remove "deletethispart." from my E-mail address ] Tag: P3P web site integration Tag: 192095
how to get file version
To know if an hotfix is installed I need to get the "complete" file version
of some files.
For "complete" file version I mean this: 5.1.2600.2726
(xpsp_sp2_gdr.050725-1528)
filever.exe available in the support tools use the following definitions:
ProductVersion: 5.1.2600.2726
FileVersion: 5.1.2600.2726 (xpsp_sp2_gdr.050725-1528)
In a VBscript with or without WMI how can I get this kind of informations?
I've already tryed to use the GetFileVersion method of the FileSystemObject
but unfortunately it returns only the "short" file version (5.1.2600.2726).
An alternate way to know if an hotfix is installed is welcome anyway.
Thanks in advance. Tag: P3P web site integration Tag: 192094
Run vbscript as post build event in VS 2005
I am trying to run a vbscript as a post build event command. I'm
running VS 2005 and creating a C# dll.
Oddly enough, VS will run other post build commands I test. But as
soon as I change it to the vbscript it doesnt work... no errors or
messages, just doesnt run. I even tried running a cmd file, which in
turn runs the script, as a post build event... with the same result.
Also, I've tested the script and that works fine too. Any ideas?
Thanks,
Larry Tag: P3P web site integration Tag: 192091
HELP ME! Script to rename multiple files and file extension to .txt files
I am working on a particular batch file to do many things, here is the
jist of it. we have a series of log files which get updated daily,
they have bizarre long file names (they are sent to us from a 3rd party
company) the files come to me looking like this file below.
www_22851.esw3c_s.200606010000-2400-1.gz
the www_22851. remains constant in all the files (although this could
change evenutally) the part after that changes up to the .gz
i have a utility to unzip the files (gzip) but due to the fact that
they are unix originated once they are unzipped they use the example (
.20606010000 * etc. ) for the file type. this utility works fine in a
batch file enviroment. In order for my unix2dos converter utility to
work they need to be in a .txt format. I need a vbscript that is
able to change all the files to a random file name with .txt extension.
for example Log1.txt Log2.txt , Log3.txt and so on but when it
creates these they cannot write over any older ones. so the file name
cannot start at log1 everytime it runs. it needs to start at whatever
the last log file was (if the last one was log3.txt then next time it
runs it needs to start at log4.txt)
Any help on this is greatly appreciated Tag: P3P web site integration Tag: 192089
HELP ME! Script to rename multiple files and file extension to .txt files
I am working on a particular batch file to do many things, here is the
jist of it. we have a series of log files which get updated daily,
they have bizarre long file names (they are sent to us from a 3rd party
company) the files come to me looking like this file below.
www_22851.esw3c_s.200606010000-2400-1.gz
the www_22851. remains constant in all the files (although this could
change evenutally) the part after that changes up to the .gz
i have a utility to unzip the files (gzip) but due to the fact that
they are unix originated once they are unzipped they use the example (
.20606010000 * etc. ) for the file type. this utility works fine in a
batch file enviroment. In order for my unix2dos converter utility to
work they need to be in a .txt format. I need a vbscript that is
able to change all the files to a random file name with .txt extension.
for example Log1.txt Log2.txt , Log3.txt and so on but when it
creates these they cannot write over any older ones. so the file name
cannot start at log1 everytime it runs. it needs to start at whatever
the last log file was (if the last one was log3.txt then next time it
runs it needs to start at log4.txt)
Any help on this is greatly appreciated Tag: P3P web site integration Tag: 192088
killing a system process
hello all
i got a vbs that can kill process
but that script doesnt able to kill SYSTEM process
as a administrator. in task manager, i can simply kill any system
process
how can i do it with scripts ? i dont mind using 3rd commandline tools
thanks
strServerName = "."
strProcessID = "calc.exe"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strServerName &
"\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = '" & strProcessID & "'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next Tag: P3P web site integration Tag: 192081
!VBscript install from UNC Path example needed
To All:
I am working on a Visual Basic script where it will install
a MSI file from a UNC path.
The problems I've encountered have to do with accessing the
.MSI from a UNC path.
If both the myapp.vbs file and the myapp.msi file (both are
similarly named) are in the same folder in the UNC path, then
how or what is the recommended way to acces the .MSI through
vbscript?
I would prefer not to map a drive as the windows server share
has many folders underneath it so it would not be easy to search
through the whole directory/tree structure to find the correct
.MSI file.
Can anyone provide an example of copying an .MSI down to the
local file system where I can access it through vbscript as
a local file system object?
I also need to know how to search through the process table
for certain process names and where found, kill them.
Thanks for any help you can offer!
Mark Withers Tag: P3P web site integration Tag: 192078
vbscript BEFORE logoff
is it possible to run a vbscript before log off which will execute a batch/
dos command? if so how do i do it?
cheers, Tag: P3P web site integration Tag: 192077
Need some help with script to read, backup remote Event logs
Hey All,
To start I am not a script write, in fact this is my 1st one.
I am trying to write a script to backup and clear the events on remote
Windows servers., the script should then write an event in to the app log on
each server that it is done, and backup the events to a remote share that has
a folder for each system.
So I have tried to write the script to pull the remote systems name from a
text file. Which is what I think I have done? Next I want use that
â??strComputerâ?? to append to the backup name string, also to use that
â??strComputerâ?? as the location of the folder on the share server. As well as
making sure that the app event log on the â??strComputerâ?? has been update.
All I seam to get to work is step one, pulling the name. Any help or
thoughts would be great. The script is below the tag line.
Thanks everyone.
Dave
--
"If you want to know the truth, you must have the courage to accept it."
- Bear (.hack//sign)
Si Vis Pacem, Para Bellum -
Script:
' *****************************************************************
'
' This VB Script will export the , Windows Servers
' Event logs to location set below. (Bkloca)
'
' It will then clear the logs in the event viewer and
' post a evt telling you which evt was cleared and when.
'
'
'******************************************************************
dtmThisDay = Day(Date)
dtmThisMonth = Month(Date)
dtmThisYear = Year(Date)
'***
Const INPUT_FILE_NAME = "C:\comps.txt"
Const FOR_READING = 1
'***
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(INPUT_FILE_NAME, FOR_READING)
strComputers = objFile.ReadAll
objFile.Close
arrComputers = Split(strComputers, vbCrLf)
'***
strBackupName = strComputers & "_" & dtmThisYear & "_" & dtmThisMonth & "_"
& dtmThisDay
'***
strBklog = "\\RemoteShareServer\evtlogs$\strComputers"
'***
Const EVENT_SUCCESS = 0
For Each strComputer In arrComputers
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate,(Backup)}!\\" & strComputer & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery ("Select * from
Win32_NTEventLogFile where LogFileName='Directory Service'")
For Each objLogfile in colLogFiles
objLogFile.BackupEventLog(strBklog & strBackupName & "_Directory
Service.evt")
objLogFile.ClearEventLog()
Next
Set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.LogEvent EVENT_SUCCESS, "The Directory Service Event Log was Backup
and Cleared. The backup is stored here:â?? & â??strBklogâ??, â??strComputerâ??
'***
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate,(Backup)}!\\" & strComputer & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery ("Select * from
Win32_NTEventLogFile where LogFileName='DNS Server'")
For Each objLogfile in colLogFiles
objLogFile.BackupEventLog(strBklog & strBackupName & "_DNS Server.evt")
objLogFile.ClearEventLog()
Next
Set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.LogEvent EVENT_SUCCESS, "The DNS Server Event Log was Backup and
Cleared. The backup is stored here:â?? & â??strBklogâ??, â??strComputerâ??
'***
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate,(Backup)}!\\" & strComputer & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery ("Select * from
Win32_NTEventLogFile where LogFileName='File Replication Service'")
For Each objLogfile in colLogFiles
objLogFile.BackupEventLog(strBklog & strBackupName & "_File Replication
Service.evt")
objLogFile.ClearEventLog()
Next
Set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.LogEvent EVENT_SUCCESS, "The File Replication Service Event Log was
Backup and Cleared. The backup is stored here:â?? & â??strBklogâ??, â??strComputerâ??
'***
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
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
objLogFile.BackupEventLog(strBklog & strBackupName & "_application.evt")
objLogFile.ClearEventLog()
Next
Set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.LogEvent EVENT_SUCCESS, "The Application Event Log was Backup and
Cleared. The backup is stored here:â?? & â??strBklogâ??, â??strComputerâ??
'***
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate,(Backup, Security)}!\\" & strComputer &
"\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery ("Select * from
Win32_NTEventLogFile where LogFileName='Security'")
For Each objLogfile in colLogFiles
objLogFile.BackupEventLog(strBklog & strBackupName & "_Security.evt")
objLogFile.ClearEventLog()
Next
Set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.LogEvent EVENT_SUCCESS, "The Security Event Log was Backup and
Cleared. The backup is stored here:â?? & â??strBklogâ??, â??strComputerâ??
'***
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate,(Backup)}!\\" & strComputer & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery ("Select * from
Win32_NTEventLogFile where LogFileName='System'")
For Each objLogfile in colLogFiles
objLogFile.BackupEventLog(strBklog & strBackupName & "_System.evt")
objLogFile.ClearEventLog()
Next
Set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.LogEvent EVENT_SUCCESS, "The System Event Log was Backup and
Cleared. The backup is stored here:â?? & â??strBklogâ??, â??strComputerâ??
next Tag: P3P web site integration Tag: 192073
ActiveX Control to get CPU ID of Client PC
Hi All,
How can I create a program / activeX Control that I will send to Client's
PC, when user visit the webpage, So that it will ask for Activex control
installation (like Microsoft windows validation control). want to create
this to get the clients CPU ID. Please help me to do this as I am new to
this concept.
- I need a program / vbscript / activeX that will collect the CPU ID and
send back to webserver.
- ASP Page that can send the above conttrol / script to client - This page
will ask for clients confirmation and the user will select YES in my case. I
will instruct the users.
- Get the CPU ID to use as security purpose.
Please help me to do this.
Thanks
Prabhat Tag: P3P web site integration Tag: 192072
Just can't get the hang of arrays in vbscript
Dim aryFields : ReDim aryFields(0)
' why I can't just put the (0) in the original dim is besides me.
Response.Write varType(aryFields)
Response.Write isEmpty(aryFields)
Response.Write isNull(aryFields)
Response.Write Ubound(aryFields)
From my output it tells me.
8204, so its a varient array
False, so it's not empty
False, so it's not null
Script out of range 'Ubound'
Seriously, if it's an array which is not null or empty, then why can't i
do ubound? I feel like it's never safe to use ubound anywhere, but I
have to anyway. My code is getting extremely bugging because of this.
What am I supposed to be doing? This just seems silly Tag: P3P web site integration Tag: 192071
Event handling in Script Control
The code below should open an instance of ie, add it to a
ScriptControl, navigate to about:blank, and catch ie's DownloadComplete
event within the ScriptControl. It's all working except for last part.
Q1. How can I get the vbscript below (.vbs file) to work (ie. call the
event handler)? This is meant to be adapted into a script control
invoked via another scripting language (PHP) so I won't have the
WScript object at my disposal.
Thanks for any tips,
Csaba Gabor from Vienna
Set ie=CreateObject("InternetExplorer.Application")
Set sc=CreateObject("MSScriptControl.ScriptControl")
sc.Language = "VBScript"
sc.AddCode "Sub Test()" & vbcrlf & _
"scie.Visible = true" & vbcrlf & _
"scie.Navigate2 (""about:blank"")" & vbcrlf & _
"End Sub"
sc.AddObject "scie", ie
sc.State=1
sc.AddCode "Sub scie_DownloadComplete()" & vbcrlf & _
"MsgBox ""DownloadComplete""" & vbcrlf & _
"End Sub"
sc.CodeObject.Test
While typename(ie)="IWebBrowser2": WScript.Sleep 50: Wend
If (sc.Error.Number<>0) Then MsgBox "Error: " & sc.Error.Number
Per the comments at
http://groups.google.com/group/microsoft.public.scripting.scriptlets/browse_frm/thread/45eac3a76f9b6117/
I have tried all six permutations of the 3 statements before the
sc.CodeObject.Test line
Also, I got the same results whether using sc.CodeObject.Test, sc.Run
"Test", sc.Eval "Test", or sc.ExecuteStatement "Test"
Q2. All the examples on the web show sc.State=connected. What is the
proper way to reference that constant (since in my .vbs file it is
undefined)? Unfortunately, I couldn't figure out the answer from the
following web site:
http://bratbaecker.de/vee/activ/msscript_ocx.htm
PS. I'm including the second group since Alex Angelopoulos (as a
followup to his April 10 posting) may wish to know that at the bottom
of the second page of the following 2003 thread there is an
unelaborated comment saying that the script control can't be passed
around.
http://www.powerbasic.com/support/forums/Forum6/HTML/002834.html
http://groups.google.com/group/microsoft.public.windows.server.scripting/browse_frm/thread/2c6bcef4194c7a9f/ Tag: P3P web site integration Tag: 192070
How do i implement P3P on my web site. i found documentation on what P3P is
but no integration documents.