ASP Text Box Array
Is it possible to make a control array in ASP similiar to
a control array in VB? I am trying to show a table that
displays several fields for different people. My goal is
to try to allow the user to update several fields in the
database without have to press an update button after
every update.
The number of people in the database could be from 1 -
1000. Here is a quick sketch of what I want to do.
code:-----------------------------------------------------
---------------------------
Name Favorite Color Birthday
Mike Smith Blue 10/7/82
Jim Beam Red 9/15/90
--Update Button--
----------------------------------------------------------
----------------------
When the update button is pressed I want to be able to
update the changes to both Mike and Jim. It just seems
repetitive to keep pressing update for each user. I don't
think it would be hard if I could make the favorite color
and birthday text boxes an array. Is this possible? If
not, have any other suggestions?
The other thing that I was thinking of is creating the
text boxes for each field in a for loop like this:
code:-----------------------------------------------------
---------------------------
for i = 1 to 2
response.write "<INPUT type="text" name=color" & i
& ">"
next
----------------------------------------------------------
----------------------
This would generate a color1 and color2 text box. But the
problem I ran into is that I can request these values.
Here is the code I tried:
code:-----------------------------------------------------
---------------------------
for i = 1 to 2
data = "color" & i
data = Request(data)
response.write "!" & data & "! <BR>"
next
----------------------------------------------------------
----------------------
All that was printed on the screen was two sets of !!.
The request wouldn't work when I used a variable instead
of a constant.
Any suggestions would be greatly appreciated. Thanks for
the help. Tag: vbscript-msql2k Tag: 150222
printing text in vbs
I have written text to lpt1 in vbs by writting to the file "LPT1:". What if
I want to write to a windows printer that is a USB printer? Also I would
really like to make the printer use a specific font or font size. Is there
an easy way to do this? In foxpro, I created a DC and used that but I can't
do that in vbs. Any Ideas are appreciated.
Thanks,
Paul Temple Tag: vbscript-msql2k Tag: 150220
export users in an OU
I need help writing a script that will export only users in a specific "OU",
any help would be great, thanks!! Tag: vbscript-msql2k Tag: 150217
permissions errors
neosoldierw@icqmail.com
power went out at my house, came back up, now i cant view
my site, says something about folder permissions not set
to read... whats up with that????
ideas send to neosoldierw@icqmail.com Tag: vbscript-msql2k Tag: 150214
ASP applications with vbscript.encode don't respond.
I have IIS 5 running on WinXP Pro at home. I am trying to run a
couple of asp applications that use vbscript.encode on most of the asp
files. When I hit the web applications, the browser clocks and then
times out with a 403 error: Headers not returned.
I do not know if the vbscript.encode is the problem, but I can hit
other asp applications that do not use encode and they work fine. I
can also create a small asp page in the same folder and it responds.
These same applications work fine on my hosted site, just not on my
home box.
Any ideas? or am I looking the wrong direction here?
Thanks,
Rick... Tag: vbscript-msql2k Tag: 150208
Translating VBScript to JScript
I'm trying to convert a MSDN routine from VBScript to JScript. I've
got everything but the last little bit. Of course like most things
without that last bit it is useless. The function gets SNMP data from
a remote device. I know that for the most part it is working (I
sniffed the network) but I haven't figured out the file translation to
get usable data.
The problem is the for loop. colSystem is an ActiveXObject and which
is apparently a container for another ActiveXObject. In VBScript the
For Each loop assigns each of the embedded objects to objSystem. My
trouble is that I have not been able to figure out the equivelent
functionality in JScript. Yes I did try "for in" but that did not
work.
The original routine in VBScript
(http://www.microsoft.com/technet/treeview/default.asp?url=/technet/ScriptCenter/network/scrnet07.asp):
********************
strTargetSnmpDevice = "192.168.0.1"
Set objWmiLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWmiServices = objWmiLocator.ConnectServer("",
"root\snmp\localhost")
Set objWmiNamedValueSet =
CreateObject("WbemScripting.SWbemNamedValueSet")
objWmiNamedValueSet.Add "AgentAddress", strTargetSnmpDevice
objWmiNamedValueSet.Add "AgentReadCommunityName", "public"
Set colSystem = objWmiServices.InstancesOf("SNMP_RFC1213_MIB_system",
, _
objWmiNamedValueSet)
For Each objSystem In colSystem
WScript.Echo "sysContact: " & objSystem.sysContact & vbCrLf & _
"sysDescr: " & objSystem.sysDescr & vbCrLf & _
"sysLocation: " & objSystem.sysLocation & vbCrLf & _
"sysName: " & objSystem.sysName & vbCrLf & _
"sysObjectID: " & objSystem.sysObjectID & vbCrLf & _
"sysServices: " & objSystem.sysServices & vbCrLf & _
"sysUpTime: " & objSystem.sysUpTime
Next
********************
My JScript version
var strTargetSnmpDevice = "192.168.0.1";
var connectServer = "winmgmts://./root/snmp/localhost";
var strQuery = "Select * from SNMP_RFC1213_MIB_system";
var wmiLocator = new ActiveXObject("WbemScripting.SWbemLocator");
var objWmiNamedValueSet =
ActiveXObject("WbemScripting.SWbemNamedValueSet");
var objWmiServices = wmiWmiLocator.ConnectServer("",
"root\snmp\localhost")
objWmiNamedValueSet.Add ("AgentAddress", strTargetSnmpDevice);
objWmiNamedValueSet.Add ("AgentReadCommunityName", "public");
var colSystem = new Enumerator
(ActiveXObject(connectServer).ExecQuery(strQuery,null,null,objWmiNamedValueSet));
// Problem Area
for (objSystem in colSystem)
{
WScript.Echo (" sysContact: " + objSystem.sysContact +
"\n sysDescr: " + objSystem.sysDescr +
"\n sysLocation: " + objSystem.sysLocation +
"\n sysName: " + objSystem.sysName +
"\n sysObjectID: " + objSystem.sysObjectID +
"\n sysServices: " + objSystem.sysServices +
"\n sysUpTime: " + objSystem.sysUpTime);
}
******************** Tag: vbscript-msql2k Tag: 150206
Script to convert form to Address Book Contact
I am a teacher and would love to find a way to create a form that my
students/parents fill out and email me and then have a macro/script take
this information and automatically create/update a contact in my Outlook
Express Address Book.
Please let me know if there is a way to accomplish this. My site is on
Comcast, and I cannot dynamically save information to the site.
Any other suggestions for quickly saving contact information would be
GREATLY appreciated!
--
Jeff Ciaccio
Dallas, GA
(W) 678-494-7863 x-274
(Fax) (W) 678-494-7865
http://home.comcast.net/~ciaccio8515/ Tag: vbscript-msql2k Tag: 150205
generating charts in vb
I'm wondering if anyone has or knows of a vbscript that will generate pie
charts and save the image in, say, GIF, BMP or other format?
I'm not looking for an ocx or AX dll, or VML displays, just wondering about
doing itcompletely in VBScript.
If anyone has an idea how or where to look I'd appreciate it.
If I figure it out or find something I'll post it.
Thanx
Fred Tag: vbscript-msql2k Tag: 150195
Deleting registry value with path
I want to delete a registry value that has a path in it, like the following:
c:\test\test2
If I try the following:
Dim WshShell
WshShell.RegDelete "HKLM\Software\Script Test\Key1\c:\test\test2"
I get the following error: Unable to remove registry key
"HKLM\Software\Script Test\Key1\c:\test\test2". I think this probably
because it is seeing the c:\test\test2 as registry keys and not a value. Is
there anything else I can do? I do not want to delete the entire registry
key.
Thanks and Merry Christmas.
Mark Tag: vbscript-msql2k Tag: 150192
copying profile in NT
Hi All,
Is there any way to copy all the profiles in a NT workstation
including that of logged on user.As NT doesn't allow copying of
current profile giving a sharing violation.How can this b achieved by
scripting.
We can achieve this in windows 2000 by run as administrator but i fear
that this method doesn't work on NT.
all suggestions and inputs are welcomed..
regards
gaurav Tag: vbscript-msql2k Tag: 150190
Prohibit user from ending process
Is there a script that will prohibit a user from being able to kill a
running process?
Any help would be great thanks!! Tag: vbscript-msql2k Tag: 150189
Get Users Parent container from query
This is a multi-part message in MIME format.
------=_NextPart_000_0015_01C3C9FA.7E933750
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Does anyone know how I can include the users parent container from the =
following script? The "ou" portion (in BLACK) is where I was trying to =
gather that, but it doesn't work.
strDNSDomain =3D objRootDSE.Get("defaultNamingContext")
strFilter =3D "(&(objectCategory=3Dperson)(objectClass=3Duser))"
strQuery =3D "<LDAP://" & strDNSDomain & ">;" & strFilter _
& ";distinguishedName,cn,ou,userPrincipalName,sAMAccountName;subtree"
The script below returns exactly what I'm looking for however, I can't =
figure out how to incorporate in into the query. I'm trying to populate
a spreadsheet with the information that is returned from the "sUserOU" =
variable.
' Connect to the LDAP server's root object
Set oADsRootDSE =3D GetObject("LDAP://RootDSE")
Set oADsSysInfo =3D CreateObject("ADSystemInfo")
' Get distinguished name of the current user
sADsUser =3D oADsSysInfo.UserName
WScript.Echo "Distinguished name: " & sADsUser
' Get user object
sUserPath =3D "LDAP://" & sADsUser
Set oADsContainer =3D GetObject(sUserPath)
sUserOU =3D oADsContainer.parent
WScript.Echo "Users OU: " & sUserOU
' Get full name of the current user
sUserNameFull =3D oADsContainer.cn
WScript.Echo "Full name: " & sUserNameFull
Here is the format that the results are returned.
Distinguished name: =
CN=3DPRH007,OU=3DAccounts,OU=3DSales,DC=3Dmydomain,DC=3Dnet
Users OU: LDAP://OU=3DAccounts,OU=3DSales,DC=3Dmydomain,DC=3Dnet
Full name: PRH007
Thanks,
Roger
------=_NextPart_000_0015_01C3C9FA.7E933750
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1264" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Does anyone know how I can include the =
users parent=20
container from the following script? The "ou" portion (in BLACK) =
is where=20
I was trying to gather that, but it doesn't work.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2><STRONG>strDNSDomain =
=3D=20
objRootDSE.Get("defaultNamingContext")<BR>strFilter =3D=20
"(&(objectCategory=3Dperson)(objectClass=3Duser))"<BR>strQuery =3D =
"<LDAP://"=20
& strDNSDomain & ">;" & strFilter _<BR> &=20
";distinguishedName,cn,<FONT=20
color=3D#000000>ou</FONT>,userPrincipalName,sAMAccountName;subtree"</STRO=
NG></FONT></DIV>
<DIV><STRONG><FONT face=3DArial color=3D#ff0000 =
size=3D2></FONT></STRONG> </DIV>
<DIV><STRONG><FONT face=3DArial color=3D#000000 =
size=3D2></FONT></STRONG> </DIV>
<DIV><STRONG><FONT face=3DArial size=3D2></FONT></STRONG> </DIV>
<DIV><STRONG><FONT face=3DArial size=3D2>The script below returns =
exactly what I'm=20
looking for however, I can't figure out how to incorporate in into the=20
query. I'm trying to populate</FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3DArial size=3D2>a spreadsheet with the =
information that is=20
returned from the "sUserOU" variable.</FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3DArial size=3D2></FONT></STRONG> </DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2>' Connect to the LDAP =
server's root=20
object<BR>Set oADsRootDSE =3D GetObject("</FONT><A =
href=3D"ldap://RootDSE"><FONT=20
face=3DArial color=3D#ff0000 size=3D2>LDAP://RootDSE</FONT></A><FONT =
face=3DArial=20
color=3D#ff0000 size=3D2>")</FONT></DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2>Set oADsSysInfo =3D=20
CreateObject("ADSystemInfo")</FONT></DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2>' Get distinguished =
name of the=20
current user<BR>sADsUser =3D oADsSysInfo.UserName<BR>WScript.Echo =
"Distinguished=20
name: " & sADsUser</FONT></DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2>' Get user =
object<BR>sUserPath =3D=20
"LDAP://" & sADsUser<BR>Set oADsContainer =3D=20
GetObject(sUserPath)</FONT></DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2>sUserOU =3D=20
oADsContainer.parent<BR>WScript.Echo "Users OU: " &=20
<STRONG>sUserOU</STRONG></FONT></DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2>' Get full name of the =
current=20
user<BR>sUserNameFull =3D oADsContainer.cn<BR>WScript.Echo "Full name: " =
&=20
sUserNameFull</FONT></DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>Here is the format that the =
results are=20
returned.</STRONG></FONT></DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial color=3D#0000ff size=3D2><STRONG>Distinguished =
name:=20
CN=3DPRH007,OU=3DAccounts,OU=3DSales,DC=3Dmydomain,DC=3Dnet<BR>Users OU: =
</STRONG></FONT><A href=3D"ldap://t"><STRONG><A=20
href=3D"ldap://OU=3DAccounts,OU=3DSales,DC=3Dmydomain,DC=3Dnet"><FONT =
face=3DArial=20
size=3D2>LDAP://</FONT></STRONG></A><STRONG><FONT face=3DArial=20
size=3D2>OU=3DAccounts,OU=3DSales,DC=3Dmydomain,DC=3Dnet</FONT></A><BR><F=
ONT face=3DArial=20
color=3D#0000ff size=3D2>Full name: PRH007</FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3DArial color=3D#0000ff =
size=3D2></FONT></STRONG> </DIV>
<DIV><STRONG><FONT face=3DArial size=3D2>Thanks,</FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3DArial size=3D2></FONT></STRONG> </DIV>
<DIV><STRONG><FONT face=3DArial size=3D2>Roger</FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3DArial size=3D2></FONT></STRONG> </DIV>
<DIV><STRONG><FONT face=3DArial color=3D#0000ff=20
size=3D2></FONT></STRONG> </DIV></BODY></HTML>
------=_NextPart_000_0015_01C3C9FA.7E933750-- Tag: vbscript-msql2k Tag: 150188
Run minimized (run silently)
Hello,
Is there a way to force a vbscript to run minimized (run silently)? If so, how?
Thanks in advance,
Bill
bill@2burkes.com Tag: vbscript-msql2k Tag: 150183
How to get multiple inputs in one input window
Hi
I am new to scripting and was wondering if anyone can help me. I have been
able to use inputbox to get a single input variable whihc I can use in the
script but I am wanting to open a single window requesting a few input
variables. Is this possible and if so can someone please help
Thanks Tag: vbscript-msql2k Tag: 150179
RemoteScript
I'm new to Scripting,
I'm having a problem with this script: This is a script cut from the
MSDN website and I just cant get it to work. I did some searches and I did
enable the registry setting "remote=1" The error I receive: Microsoft
VBScript runtime error: ActiveX component can't create object. And sometimes
I receive: "(null): Catastrophic failure", even when I try to run the script
locally I still receive the same error. I'm really trying to learn this but
I have been working on this problem alone for five hours and I dont know
what else to try. I am running XP pro and Win2k Pro both with WSH 5.6
Thanks in Advance
Frank A, Zanotti
fzanotti@panix.com
Dim Controller, RemoteScript
Set Controller = WScript.CreateObject("WSHController")
Set RemoteScript = Controller.CreateScript("test01.vbs", "server01")
RemoteScript.Execute
Do While RemoteScript.Status <> 2
WScript.Sleep 100
Loop*****Seperate Script*****Test01.vbs:Set objNetwork =
CreateObject("WScript.Network")objNetwork.MapNetworkDrive "x:",
\\server01\share Tag: vbscript-msql2k Tag: 150175
Unserialize / Serialize function equivalent to PHP functions
i was wondering if anyone had equivalent functions to PHP's
Unserialize/serialize functions?
i'm trying to convert some PHP code to VBScript .... one portion of
the code includes 2-dimensional arrays, which VBScript's functions of
Split and Join are not handling very well. from what i can tell, the
PHP code takes a 2-dimensional array and "serializes" it to put in a
table. one record from this table looks like so:
a:3:{s:7:"Content";a:1:{s:2:"Id";i:151;}s:6:"Static";a:4:{s:6:"Exists";i:1;s:2:"Id";i:150;s:3:"Pos";s:3:"top";s:4:"Size";s:2:"92";}s:10:"Navigation";a:1:{s:6:"Exists";i:0;}}
somehow i am to "unserialize" this string and put it into a 2
dimensional array. i'm having a time interpreting the string. thats
why i'm hoping someone has functions already built that is equivalent
to these PHP functions
any help will be greatly appreciated. thanks! Tag: vbscript-msql2k Tag: 150170
DLookup in VBScript
Hello,
I'm a fairly experienced VB/VBA programmer, but a newbie
to VBScript. Currently, I'm converting existing Access
dbase forms into data access pages (DAP) for web access.
All existing VBA codes have to be converted to VBScript,
and I've encountered a problem with the DLookUp method.
I get the error: "Type mismatch: 'DLookup'"
This is the original code in the Access form
varPartName = RTrim(DLookup
("[PART_DESC]", "ICFPM", "[PART_ID]=txtPartID.Value"))
txtPartName.Value = varPartName
Quickly translated: Find the Part Description from table
ICFPM where the Part ID equals txtPartID.Value from the
form. Insert the value into txtPartName.
Is DLookup not supported in VBScript? If so, what can I
use instead? I'm using an unbound DAP form in Access.
Thanx,
Isbjornen. Tag: vbscript-msql2k Tag: 150167
Installing fonts programmatically
Instead of copying a font to the fonts folder in Windows and editing
the registry (which does not always work), try using the "expand"
command to place the font in the folder. This seems to cause Windows
to recognize and install the font correctly. It works for me! Tag: vbscript-msql2k Tag: 150164
RegExp - how to limit number of digits in a date?
Hello,
I want to check for specific date formats like
1/1/01 or 01/01/01 or 1/1/2001 or 01/01/2001
Here is one thing (of serveral things) I tried
RE.Pattern = "[0-9]{1,2}/[0-9]{1,2}/[0-9]{2}"
Debug.Print RE.test("0/1/100")
This returns true, but the year part is incorrect. If I
only have one digit in the year then it returns false.
But if I have 2 or more digits, it returns true
RE.Pattern = "[0-9]{1,2}/[0-9]{1,2}/[0-9]{2,4}"
Debug.Print RE.test("0/1/100")
This also returns true for a year with 3 digits. How do I
limit/retrict the number of digits? I imagine I would
have the same problem with the month and day parts also.
Any suggestions appreciated how to restrict/limit the
number of digits (for anything).
Thanks,
Rich Tag: vbscript-msql2k Tag: 150154
How can I call functions inside a DLL in VBS
Hi,
I want to use some routines like in user32.dll A have know the parmeters but
don't know how to call
In VB6 A use a declare and than use : call routine(par1,par2)
Jan Tag: vbscript-msql2k Tag: 150152
Need help on AD.
Hello,
Running: Windows Server 2003
Problem: 730 Users need their Terminal Services User
Profile Path changed from one server to another but
keeping the same attributes.
Example: Domain is tfa.local, OU is Users. It checks the
user name and the terminal services profile path, and
sees if the path is \\server1\profile$\(username). If it
is, then it changes it to \\server2\profile$\(username),
and does this until all are changed. Is this possible? I
have been trying out other snippits of code online and it
gives me every single stinking error it possibly can.
Thank you. Tag: vbscript-msql2k Tag: 150151
Remote install
This is a multi-part message in MIME format.
------=_NextPart_000_002C_01C3C930.E9CC2830
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello all, ive written a script that is trying to connect to a remote =
computer, map the root drive C:, locally to Z: as a shared network drive =
and then remotley run the program that was copied over. however ive ran =
into trouble and im getting this error when I run the script:
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
swspmanager.exe | IP.txt
Connecting to 10.10.10.64...
Installing swspmanager.exe...
Failed to start process on 10.10.10.64: 9
This is the code of the script,,, Please help if you can!
THANK YOU!
'Test to install/run a program on a remote machine
on error resume next
If right(ucase(wscript.FullName),11)=3D"WSCRIPT.EXE" then
wscript.echo "ERROR: You must run this script using cscript, for =
example 'cscript " & wscript.scriptname & "'."
wscript.quit 0
end if
Program =3D wscript.arguments(0)
If (Program =3D "") then
wscript.echo "Install.vbs (program) (remote IP File) (local path)"
wscript.quit
end if
IPFile =3D wscript.arguments(1)
LocalPath =3D wscript.arguments(2)
'To Check if it picked up the correct file name's
wscript.echo Program & " | " & IPFile
if (LocalPath =3D "") then
LocalPath =3D "C:\default path\"
end if
set onet =3D createobject("wscript.network")
set ofs =3D createobject("scripting.filesystemobject")
'Assumes that the ipfile is in the local directory.
ipFile =3D Localpath + ipFile
'Verify that ipfile is accessible.
set oipFile =3D ofs.opentextfile(ipFile, 1, false)
if (Err.Number <> 0) then
wscript.echo "Cannot open " & ipFile
wscript.quit
end if
set osvcLocal =3D getobject("winmgmts:root\cimv2")
while not oipFile.atEndOfStream
ip =3D oipFile.ReadLine()
wscript.echo vbCrLf & "Connecting to " & ip & "..."
Err.Clear
set osvcRemote =3D GetObject("winmgmts:\\" & ip & "\root\cimv2")
if (Err.Number <> 0) then
wscript.echo "Failed to connect to " & ip & "."
else
wscript.echo osvcRemote
if (Program <> "") then
' Lay the bits on the remote computer.
wscript.echo "Installing " & Program & "..."
onet.mapnetworkdrive "z:", "\\" & ip & "\C$"
set osourceFile =3D osvcLocal.get("cim_datafile=3D""" & =
replace(LocalPath, "\", "\\") & Program & """")
ret =3D osourceFile.Copy("z:\\Program.exe")
if (ret <> 0 and ret <> 10) then
' Failure detected and failure was not "file already =
exists."
wscript.echo "Failed copy to " & ip & " - error: " & =
ret
else
set oprocess =3D osvcRemote.Get("win32_process")
=20
' Start the installation without user interaction, =
and force a restart after completion.
' * Modified not to reboot to prevent user =
interuption
ret =3D oprocess.create("c:\\Program.exe")
if (ret <> 0) then
wscript.echo "Failed to start process on " & ip =
& ": " & ret
else
' Get a reference to the file that was copied.
set odestFile =3D =
osvcLocal.get("cim_datafile=3D""z:\\Program.exe""")
' Wait for the installation to complete.
for waitTime =3D 0 to 500 ' Lay and =
wait--up to five minutes for the installation to complete.
wscript.Sleep 1000 ' Sleep one second.
' Delete temporary file as soon as =
possible after it is freed.
if (odestFile.Delete() =3D 0) then
exit for
end if
next ' Otherwise, loop again and keep =
waiting...
wscript.echo "Installation successful."
end if 'Create process succeeded.
end if 'Copy succeeded.
onet.removenetworkdrive "z:", true
end if ' The script knows which patch to install.
end if ' Do the next IP address, then the next IP address...=20
wend
ipFile.close()
------=_NextPart_000_002C_01C3C930.E9CC2830
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1276" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>Hello all, ive written a script that is =
trying to=20
connect to a remote computer, map the root drive C:, locally to Z: as a =
shared=20
network drive and then remotley run the program that was copied =
over. =20
however ive ran into trouble and im getting this error when I run the=20
script:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>Microsoft (R) Windows Script =
Host Version=20
5.6<BR>Copyright (C) Microsoft Corporation 1996-2001. All rights=20
reserved.</STRONG></FONT></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>swspmanager.exe |=20
IP.txt</STRONG></FONT></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>Connecting to =
10.10.10.64...<BR>Installing=20
swspmanager.exe...<BR>Failed to start process on 10.10.10.64:=20
9</STRONG></FONT></DIV>
<DIV><STRONG><FONT face=3DArial size=3D2></FONT></STRONG> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>This is the code of the script,,, =
Please help if=20
you can!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>THANK YOU!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>'Test to install/run a program on a =
remote=20
machine<BR>on error resume next</FONT></DIV>
<DIV> </DIV><FONT face=3DArial size=3D2>
<DIV><BR>If right(ucase(wscript.FullName),11)=3D"WSCRIPT.EXE"=20
then<BR> wscript.echo "ERROR: You must run this =
script=20
using cscript, for example 'cscript " & wscript.scriptname &=20
"'."<BR> wscript.quit 0<BR>end if</DIV>
<DIV> </DIV>
<DIV>Program =3D wscript.arguments(0)</DIV>
<DIV> </DIV>
<DIV>If (Program =3D "") then<BR> wscript.echo "Install.vbs =
(program) (remote=20
IP File) (local path)"<BR> wscript.quit<BR>end if</DIV>
<DIV> </DIV>
<DIV>IPFile =3D wscript.arguments(1)<BR>LocalPath =3D =
wscript.arguments(2)</DIV>
<DIV>'To Check if it picked up the correct file name's<BR>wscript.echo =
Program=20
& " | " & IPFile</DIV>
<DIV> </DIV>
<DIV>if (LocalPath =3D "") then<BR> LocalPath =3D "C:\default =
path\"<BR>end=20
if</DIV>
<DIV> </DIV>
<DIV>set onet =3D createobject("wscript.network")<BR>set ofs =3D=20
createobject("scripting.filesystemobject")</DIV>
<DIV> </DIV>
<DIV>'Assumes that the ipfile is in the local directory.</DIV>
<DIV>ipFile =3D Localpath + ipFile</DIV>
<DIV> </DIV>
<DIV>'Verify that ipfile is accessible.<BR>set oipFile =3D=20
ofs.opentextfile(ipFile, 1, false)<BR>if (Err.Number <> 0)=20
then<BR> wscript.echo "Cannot open " &=20
ipFile<BR> wscript.quit<BR>end if</DIV>
<DIV> </DIV>
<DIV><BR>set osvcLocal =3D getobject("winmgmts:root\cimv2")</DIV>
<DIV> </DIV>
<DIV>while not oipFile.atEndOfStream<BR> ip =3D=20
oipFile.ReadLine()<BR> wscript.echo vbCrLf & =
"Connecting to " & ip & "..."</DIV>
<DIV> </DIV>
<DIV> Err.Clear<BR> set=20
osvcRemote =3D GetObject("winmgmts:\\" & ip & =
"\root\cimv2")</DIV>
<DIV> </DIV>
<DIV> if (Err.Number <> 0)=20
then<BR> =
wscript.echo=20
"Failed to connect to " & ip & "."<BR> =20
else<BR> wscript.echo osvcRemote</DIV>
<DIV> </DIV>
<DIV> if (Program =
<>=20
"")=20
then<BR>  =
; =20
' Lay the bits on the remote=20
computer.<BR> =
=20
wscript.echo "Installing " & Program & "..."</DIV>
<DIV> </DIV>
<DIV> &n=
bsp; =20
onet.mapnetworkdrive "z:", "\\" & ip &=20
"\C$"<BR> &nbs=
p; =20
set osourceFile =3D osvcLocal.get("cim_datafile=3D""" & =
replace(LocalPath, "\",=20
"\\") & Program &=20
"""")<BR> &nbs=
p; =20
ret =3D osourceFile.Copy("z:\\Program.exe")</DIV>
<DIV> </DIV>
<DIV> &n=
bsp; =20
if (ret <> 0 and ret <> 10)=20
then<BR>  =
; =20
' Failure detected and failure was not "file already=20
exists."<BR> &=
nbsp; =20
wscript.echo "Failed copy to " & ip & " - error: " &=20
ret<BR> =
=20
else<BR>  =
; =20
set oprocess =3D =
osvcRemote.Get("win32_process")<BR> =20
<BR> &nb=
sp; =20
' Start the installation without user interaction, and force a restart =
after=20
completion.<BR> &nbs=
p; =20
' * Modified not to reboot to prevent user=20
interuption<BR> &nbs=
p; =20
ret =3D=20
oprocess.create("c:\\Program.exe")<BR>  =
; =
=20
if (ret <> 0)=20
then<BR>  =
; =
=20
wscript.echo "Failed to start process on " & ip & ": " &=20
ret<BR> =
=20
else<BR>  =
; =
=20
' Get a reference to the file that was=20
copied.<BR> &n=
bsp; &nb=
sp; =20
set odestFile =3D =
osvcLocal.get("cim_datafile=3D""z:\\Program.exe""")</DIV>
<DIV> </DIV>
<DIV> &n=
bsp; &nb=
sp;=20
' Wait for the installation to=20
complete.<BR> =
&=
nbsp; =20
for waitTime =3D 0 to 500 ' Lay and wait--up to =
five=20
minutes for the installation to=20
complete.<BR> =
&=
nbsp; =20
wscript.Sleep 1000 ' Sleep one=20
second.<BR> &n=
bsp; &nb=
sp; =20
' Delete temporary file as soon as possible after it is=20
freed.<BR> &nb=
sp; &nbs=
p; =20
if (odestFile.Delete() =3D 0)=20
then<BR>  =
; =
=20
exit=20
for<BR> =
&=
nbsp; =20
end=20
if<BR> &=
nbsp; &n=
bsp;=20
next ' Otherwise, loop again and keep waiting...</DIV>
<DIV> </DIV>
<DIV> &n=
bsp; &nb=
sp;=20
wscript.echo "Installation successful."</DIV>
<DIV> </DIV>
<DIV> &n=
bsp; =20
end if 'Create process=20
succeeded.<BR>  =
; =20
end if 'Copy succeeded.</DIV>
<DIV> </DIV>
<DIV> &n=
bsp; =20
onet.removenetworkdrive "z:",=20
true<BR> end=20
if ' The script knows which patch to=20
install.<BR> end if ' Do the next IP address, =
then the=20
next IP address... <BR>wend</DIV>
<DIV> </DIV>
<DIV>ipFile.close()</FONT></DIV></FONT></DIV></FONT></DIV></BODY></HTML>
------=_NextPart_000_002C_01C3C930.E9CC2830-- Tag: vbscript-msql2k Tag: 150150
FilesSystemObject line parsing Question
Hello everyone, hope you're all well!
I've recently started experimenting with the WSH FSO and needed some
help with a scenario.
Let's say I have a line in a text file that looks like the following:
"KeyUsername=username.ID"
I'd like to change this to "k:\myserver\myfiles\username.id". How
would I go about parsing this line and modifying it, taking into
consideration that the username is unique for every user's file.
Thanks
MT Tag: vbscript-msql2k Tag: 150148
admin site
Hello All!
Happy Holydays!
I am developing an Admin site that will have all of the links to all of the
servers, routers and other crucial things. I have a every day routine to
check all of the event viewer logs, space on the servers and things like
that. Now this is becoming a pain when you have more than few servers. It
would take me hours.
Now, I have seen someone developed some kind of code to display server
alerts, errors and events on the webpage. Is there a way for me to extend my
Admin site and develop a page where all of the errors in logs will be
showing up and all of the disk info for every server will be showing up too?
Lets say, have one page for each server or have page for disk space and have
total, used and available space for every server and every disk or array.
Than, have other page for events only.
Please let me know how to do this or how it is supposed to be done as my
routine is just pain every day.
Best regards, George
P.S. Please reply to group as I am posting this question to mere than one
group. Tag: vbscript-msql2k Tag: 150136
Virus Check a blob
Hi,
does anyone know if Norton or Mcafee Anti-Virus software support the ability
of checking a blob of data for viruses?
please advise.
thanks Tag: vbscript-msql2k Tag: 150133
[off the topic, sorry] online airline reservation ratio
Really sorry, but I don't know any NG but this one.
online airline reservation ratio
I want to know how many Americans buy airline ticket online. More exactly I
want keywords to search in Google. Or some other websites. I tried the above
keyword without success.
I'm not a spammer, but all the bright/kind people I know are here.
I've replied a lot here but not so nowadays because of lots of difficult
questions.
Have nice day. Seoul. Pohwan, Han. Tag: vbscript-msql2k Tag: 150129
Delete Registry sub-key
In vbscript, I want to be able to delete multiple registry entries with
sub-keys. I have only been able to delete a key if there are no sub-keys.
If there are sub-keys I get an error when I try deleting the key. I figured
that I would just enumerate the sub-keys but I didn't have any luck with
this. How would I do this if there are 4 or 5 levels underneath the original
entry that I want to remove, and some may only have 0 to 1.
Thanks.
Mark Tag: vbscript-msql2k Tag: 150128
Deleting Registry values
This is a multi-part message in MIME format.
------=_NextPart_000_000A_01C3C881.4AC8DD00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have this script below that I wrote that populates the contact list in =
Exchange Messenger. As seen, the list is stored in the registry under =
HKCU\Software\Microsoft\Exchange\Messenger\Profiles\http://bbhtx.org/inst=
msg/aliases/[USERNAME]\Contacts\. As I am new to registry scripting, I =
was wondering what the best method to "clear out the contacts first". =
In other words, I want to make sure if there are any entries, that they =
get deleted first (this way the contact list doesn't keep all ex-users =
in it). =20
The two questions are where should I delete them at (ie do I just delete =
all of contacts or is there a method to delete all the entries in =
contacts) and two do I need to first test if they exist (ie if the =
contacts doesn't exist yet because the user hasn't been set up). =20
Any thoughts or infor would be appricated
Set WshShell=3D WScript.CreateObject("Wscript.Shell")
Set wnet=3DCreateObject("Wscript.Network")
strUsername=3D wnet.username
Set ObjOU=3D =
GetObject("LDAP://ou=3Dstaff,DC=3Dbaltimorebehavioralhealth,DC=3Dorg")
For Each ObjUser In ObjOU
If ObjUser.msexchIMaddress <> "" then=20
strreg=3D =
"HKCU\Software\Microsoft\Exchange\Messenger\Profiles\http://bbhtx.org/ins=
tmsg/aliases/" & strusername & "\Contacts\"
strKey=3D strreg & objUser.msexchIMaddress
WshShell.RegWrite strKey, objUser.msexchIMaddress
end if
next
--=20
Robert Cohen
A legend in his own mind
--
------=_NextPart_000_000A_01C3C881.4AC8DD00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1276" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I have this script below that I wrote =
that=20
populates the contact list in Exchange Messenger. As =
seen, the list=20
is stored in the registry=20
under HKCU\Software\Microsoft\Exchange\Messenger\Profiles\http://bbh=
tx.org/instmsg/aliases/[USERNAME]\Contacts\. =20
As I am new to registry scripting, I was wondering what the best method =
to=20
"clear out the contacts first". In other words, I want to make =
sure if=20
there are any entries, that they get deleted first (this way the contact =
list=20
doesn't keep all ex-users in it). </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The two questions are where should I =
delete them at=20
(ie do I just delete all of contacts or is there a method to delete all =
the=20
entries in contacts) and two do I need to first test if they exist (ie =
if the=20
contacts doesn't exist yet because the user hasn't been set up). =20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Any thoughts or infor would be=20
appricated</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Set WshShell=3D=20
WScript.CreateObject("Wscript.Shell")<BR>Set=20
wnet=3DCreateObject("Wscript.Network")</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>strUsername=3D =
wnet.username</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Set ObjOU=3D GetObject("<A=20
href=3D"ldap://ou=3Dstaff,DC=3Dbaltimorebehavioralhealth,DC=3Dorg">LDAP:/=
/ou=3Dstaff,DC=3Dbaltimorebehavioralhealth,DC=3Dorg</A>")</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>For Each ObjUser In ObjOU<BR>If=20
ObjUser.msexchIMaddress <> "" then </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>strreg=3D=20
"HKCU\Software\Microsoft\Exchange\Messenger\Profiles\http://bbhtx.org/ins=
tmsg/aliases/"=20
& strusername & "\Contacts\"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>strKey=3D strreg &=20
objUser.msexchIMaddress</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>WshShell.RegWrite strKey,=20
objUser.msexchIMaddress<BR>end if<BR>next<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><BR>-- <BR>Robert Cohen<BR>A legend in =
his own=20
mind<BR>--<BR></FONT></DIV></BODY></HTML>
------=_NextPart_000_000A_01C3C881.4AC8DD00-- Tag: vbscript-msql2k Tag: 150126
Trigger the event
when I click on link, I open a new window.
Then when I close a new window, I would like that one button on the opener
page(the page from which was new window opened) is clicked or anything else,
do something on the opener page for example:
msgbox window.parent.document.getElementById("lblNaslov").name
This doesn't work, I don't get displayed the id of this element.
When I close the new window I must trigger the click event on the
original,opener page.
How can I do that?
thank you for your answer,
Simon Tag: vbscript-msql2k Tag: 150112
cannot use parenthesis when calling a sub
I'm trying to add some vbscript to my code but keep
getting the following error:
"cannot use parenthesis when calling a sub"
I'm adding an onclick attribute to my code thus:
txtAmount.Attributes("onclick") = "Hello()"
and in the script block I have:
<script language="vbscript">
Sub Hello()
MsgBox("Can you see this?", vbYesNo, "Cancel")
End Sub
</script>
This just doesn't seem to work. I'm using some
javascript and that works fine, but not the vb!
This must be a common issue?
Thanks
Damon Tag: vbscript-msql2k Tag: 150101
Debugger problems.
Hi,
I have am running Windows XP PRo with Service Pack 1. My machine works fine
except I cannot debug vbs scripts.
Fox example:
The script test.vbs
msgbox "Hello"
wscript.echo "Hello"
cscript //X //D test.vbs - no debugger.
cscript test.vbs //X //D - no debugger.
I have check out :
http://support.microsoft.com/default.aspx?scid=kb;en-us;308364
and still no luck. As well on my machine I have VS NET 2003 and the scipt
debugger.
Any ideas,
Thanks Ward Tag: vbscript-msql2k Tag: 150099
Writing a REG_BINARY Hex value
All
I am trying to write a REG_BINARY value, which I need the value to be
"0003041f"=hex:02,00,00,00
I am attempting to set the above through the below line
WSHShell.RegWrite "HKCU\Test\0003041f", &h02000000, "REG_BINARY"
but it is failing miserably .... and looking like the below
"0003041f"=hex:00,00,00,20
Now as this is only 4 octets I am assuming that this is possible through the
VBScript rather than shelling out and running a regedit /s somefilename.reg
Can somebody help me please ?
Cheers
Sean Tag: vbscript-msql2k Tag: 150094
Broken ASP Form
Hi,
I'm new to ASP and can't get this form to work. It's a simple page
that draws a calendar for the current month and then you can select a
new month and/or year and it draws the new calendar. It works fine the
first time I load the page (no form submission) but doesn't work when
I submit the form. It doesn't seem to be properly evaluating the first
if statement for drawing the calendar but all the variables seem to be
correct (i.e. it it using
the values passed from the form). Also after submitting the form the
select menus show the proper month but not the proper year. Any
suggestions? It's running on Windows 2000, IIS 5. The code is below.
Thanks in advance.
Mike
<%@ Language=VBScript %>
<% Option Explicit %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 transitional//en">
<html>
<head>
<title>calendar</title>
</head>
<body topmargin="0" leftmargin="0" bgcolor="#FFFFFF" text="#000000"
marginwidth="0" marginheight="0">
<%
'declare variables
Dim currentYear, firstDay, currentDate, currentMonth, i, y, start,
finish
if (Request.form("themonth")) then
currentMonth = Request.form("themonth")
else
currentMonth = Month(Date)
end if
if (Request.form("theyear")) then
currentYear = Request.form("theyear")
else
currentYear = Year(Date)
end if
currentDate = DateSerial(currentYear, currentMonth, 1)
firstDay = Weekday(currentDate)
%>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<form action="calendar.asp" method="post">
<tr>
<td colspan="7" align="center">
<select name="themonth">
<option value="1" <% if (currentMonth = 1) then Response.write "
selected" %>>january</option>
<option value="2" <% if (currentMonth = 2) then Response.write "
selected" %>>february</option>
<option value="3" <% if (currentMonth = 3) then Response.write "
selected" %>>march</option>
<option value="4" <% if (currentMonth = 4) then Response.write "
selected" %>>april</option>
<option value="5" <% if (currentMonth = 5) then Response.write "
selected" %>>may</option>
<option value="6" <% if (currentMonth = 6) then Response.write "
selected" %>>june</option>
<option value="7" <% if (currentMonth = 7) then Response.write "
selected" %>>july</option>
<option value="8" <% if (currentMonth = 8) then Response.write "
selected" %>>august</option>
<option value="9" <% if (currentMonth = 9) then Response.write "
selected" %>>september</option>
<option value="10" <% if (currentMonth = 10) then Response.write "
selected" %>>october</option>
<option value="11" <% if (currentMonth = 11) then Response.write "
selected" %>>november</option>
<option value="12" <% if (currentMonth = 12) then Response.write "
selected" %>>december</option>
</select>
<select name="theyear">
<%
start = currentYear - 1
finish = currentYear + 3
for y=start to finish
Response.write "<option value=""" & y & """"
if (y = currentYear) then Response.write " selected"
Response.write ">" & y & "</option>"
next
%>
</select>
<input type="submit" name="submit" value="go">
</td>
</tr>
</form>
<tr>
<td>sunday</td>
<td>monday</td>
<td>tuesday</td>
<td>wedenesday</td>
<td>thursday</td>
<td>friday</td>
<td>saturday</td>
</tr>
<tr>
<%
'draw calendar
For i=1 to 42
Response.Write "<td>"
if(month(currentdate)<>currentmonth) or (i < firstDay) then
Response.write " "
else
Response.write Day(currentDate)
end if
Response.write "</td>"
if (i mod 7)="0" Then
Response.write "</tr>"
end if
if (i >= firstDay) Then
currentDate=dateAdd("d", 1, currentDate)
end if
Next
%>
</table>
</body>
</html> Tag: vbscript-msql2k Tag: 150085
IIS Authentication Possible?
Hi
I have created a login ASP page with VBS that
authenticates users on a SQL table. There are 4 different
security levels and users will have access, redirected
according to their security level.
My question is; Is it possible to use IIS authentication
instead? Maybe a script that can read NT Local usernames;
paswords; groupmembership? Is this possible with VBS?
Any advice would be appreciated.
Regards
Marnus Tag: vbscript-msql2k Tag: 150083
new skins appearance
View Message Thread (4 replies)
Results 1 - 5 of 5
cleaner appearance
From: Scott
Date Posted: 12/20/2003 5:35:00 PM
Hello,
I just started using VB6. I was hoping to make a cleaner user interface
than with VB5. Does VB6 make the kind of clean interfaces that we see in a
lot of products, or are those interfaces made with C++?
Any help on this, or sample applications would be great.
Thanks.
Scott Baxter
www.baxtsoft.com
Hello,
One of you helped me with the question below with the web site
www.vbaccelorator.com This is great, but I can't get the samples on this
site to work, something is always missing when I try to execute them. Can
someone help me figure out how to have everything that is needed to run the
sample programs with new 'skins'?
Thanks.
Scott
> I just started using VB6. I was hoping to make a cleaner user interface
> than with VB5. Does VB6 make the kind of clean interfaces that we see in a
> lot of products, or are those interfaces made with C++?
If by 'clean' you're talking about skinned or typically non 'typical'
Windows looking windows then you'll want to be looking into
sub-classing. You'll find a bunch of examples including a skinning component
over on Http://www.vbaccelerator.com/ Tag: vbscript-msql2k Tag: 150079
Windows Game Removal
I found examples of how to permenetly remove Windows games, Solitare,
Free Cell and Pinball but how do I automate this for several thousand pc's?
********************************************************
Hi Steve,
Windows Games are considered system files so they are hidden
from the Add-Remove programs list by default. The following is
a step by step guide I made to help you overcome this obstacle:
First, we are going to unhide all files and file extensions:
1. Choose Start / Programs / Accessories / Windows Explorer.
2. In Windows Explorer, choose Tools / Folder Options.
3. Click the View tab in the Folder Options dialog box.
4. Double-click Hidden Files and Folders, and then select Show Hidden Files
and Folders.
5. Deselect Hide File Extensions for Known File Types, and then click OK.
Now we are going to edit the Sysoc.inf file to unhide all games:
1. Choose Start / Run / Copy+Paste the next line into the RUN box and press
[ENTER]:
notepad %SystemRoot%\Inf\Sysoc.inf
2. Scroll down until you find the line that reads:
Games=ocgen.dll,OcEntry,games.inf,HIDE,7
and delete the HIDE from the line so it now reads:
Games=ocgen.dll,OcEntry,games.inf,,7
3. Below the is the line that reads:
AccessUtil=ocgen.dll,OcEntry,accessor.inf,HIDE,7
delete the word HIDE from the line so it now reads:
AccessUtil=ocgen.dll,OcEntry,accessor.inf,,7
4. Scroll down a little to the line that reads:
Pinball=ocgen.dll,OcEntry,pinball.inf,HIDE,7
and delete the word HIDE from the line so it now reads:
Pinball=ocgen.dll,OcEntry,pinball.inf,,7
5. Click File / Exit and choose YES to save the changes you made to the
file.
6. Click Start / Settings / Control Panel / Add-Remove Programs.
7. Select and Remove any of the games you want from the list.
--
Cheers,
Jimmy S.
********************************************************* Tag: vbscript-msql2k Tag: 150074
Radio Button Calculation
I have several radio buttons (say 5). I want it to run a
calculation based on the combination of the button that
are checked. I can't seem to get it right because the
answer is not updated. For example, if A, B and C are
checked I should get an answer of 60. When A and B are
checked I should get 35. If A only I should get 18.
However, I may get some of it correct, but the others are
not. It seems that whichever part is right first will be
the answer given. I'm using an if...then ...else statement.
Can anyone help? Tag: vbscript-msql2k Tag: 150073
Control Acroread
I'd like to write a VB script which closes a document in acroread and opens
another one. Is such a thing possible and if so where can I find a tutorial,
sample script...
Thanks
Lutz Tag: vbscript-msql2k Tag: 150072
asp project to interface to VSS (sourcesafe)
Hello coders,
(right click and save as)
http://mysite.verizon.net/res1ur2j/VSS_1.2.9.mxp
the above is a Dreamweaver MX project to make an
ASP web interface to Sourcesafe.
If anyone here uses Dreamweaver can you load this
project (proprietary binary file) and extract any
relevant ASP/VBScript content, please?
I want to see how the VSS Automation code works.
This file can be freely downloaded from the
DMX zone web site for free if you register. This
is all on the up and up.
tia,
msp
AIM:Rot13(gyivrjre) Tag: vbscript-msql2k Tag: 150071
accessing an access (.mdb) file on my pc and the net
Is there a way to access a .mdb (Access) file on my pc and on my web site at
the same time. The idea here would be to be able to update one from the
other directly.
Please let me know where to look for this, any sample code would be great.
Thanks.
Scott Baxter Tag: vbscript-msql2k Tag: 150066
checksum to be applied in VB script
Hi All,
And i have a new problem here, I am copying a lot of files(*.txt,*.doc
etc) to a remote machine, now is there any way i can apply a checksum
on that.I need to verify wheather all the required files have been
copied correctly.Any ways u guys can suggest to apply that.
Thanks in advance for ur suggestions.
Gaurav Tag: vbscript-msql2k Tag: 150050
VBS close any executable
Any way to have a VBS script close an Executable, for example, close
Internet Explorer (iexplore.exe)?
Any help would be great thanks! Tag: vbscript-msql2k Tag: 150048
File Version in Other Version Information
I am attempting to find the File Version of a file and am specifically
looking for the File Version that appears in the Other Version
Information. The value of File Version is different than the File
Version value in the Other Version Information section and this Other
Version Information File Version value is what I need to properly
identify the file (happens to be a graphics driver file). I have
searched the newsgroups and have been unsuccessful. I have attempted
the following:
1. Using the GetFileVersion of the FileSystemObject and
2. GetDetailsOf
The GetDetailsOf is close but I am not seeing the values I am
expecting. I am wondering if this specific extended property is NOT
retrievable. It would seem there is a way but I have yet to find it.
I have also searched the registry and have been unsuccessful going
that route as well. Of course I may be overlooking a much simpler
solution, so I am open to any feedback/assistance.
Thanks in advance.
R Tag: vbscript-msql2k Tag: 150047
Advice on reporting via ASP
Hello everyone,
I have recently developed a web application across my clients intranet. We
used ASP with Interdev 6.0 and SQL server as the backend.
They have now come to me asking me to develop some reports that can be
accessed via a drill down within the app. They don't have Crystal Reports so
this is not an option. Can anyone suggest an alternative to using crystal
reports to publish dynamic reports via the web and ASP?
Thanks in advance,
Jeff Tag: vbscript-msql2k Tag: 150046
Email Attachment Using VBScript
Hello,
I am using the following code that I found on this message board to try and
send an email attachment. It is not working. Depending on what I change I
keep getting one of three different errors. I get an error stating that the
specified protocol is unknown; I also get an error that the system cannot
find the file specified when I know it is in the correct location; and I get
an error stating that the Object doesn't support this property or method:
'objMessage.AddAttachment'. Can anyone help with this? I was trying to run
this on my SMTP server directly.
Thanks,
Robbie
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "someone@somedomain.com"
objEmail.To = "account@domain.com"
objEmail.Subject = "test message"
objEmail.AddAttachment "d:\attachment.txt"
objEmail.textbody = "Text of message goes here"
objEmail.Send Tag: vbscript-msql2k Tag: 150037
Reading first 2 characters/line from textfile
This is probably a stupid thing, but I have a killer headache and
can't see the problem. I have an asp page that reads from a
tab-delimited text file.
textfile = fileObj.OpenTextFile(Server.MapPath("textfile.txt"), 1)
My script is SUPPOSED to move through the text file line by line and
perform the following:
- set a variable "key" to the first two characters of the line
- if key matches another variable ("selection"), then do a bunch of
stuff. if not, move to the next line.
Everything works perfectly EXCEPT -- in addition to getting the
results I expect, I am getting a match if the two characters exist
anywhere in the line.
Here's the code for this part:
do while textfile.AtEndOfStream = false
key = textfile.Read(2)
if key = selection then
(blah blah blah)
end if
loop
I understood that Read(2) would read the first two characters of the
line unless I did something that moved the cursor. Do I need to
specify the beginning of the line? Or is something else going on?
My textfile looks something like this:
ST Address City Zip
Where ST is the two letter abbreviation for state. But I'm getting a
match for Nebraska (NE) if the line looks like:
CA 1234 Main NE San Diego 97111
Help??? Tag: vbscript-msql2k Tag: 150035
stdregprov enumkey problem
I am having difficulty with enumerating the contents of
the HKEY_USERS key of the registry. When I run it against
a Windows XP Pro SP1 box, it works properly. However, a
Windows 2000 Pro SP4 box does not return the correct
information (It looks like it might be information from
the HKEY_CURRENT_USER?).
I suspect it's a problem with the provider, but don't
know for sure. If so, is anyone aware of a workaround?
TIA,
Stephen
Here's my code:
PCName = "."
Set objLocator = CreateObject
("WbemScripting.SWbemLocator")
Set objService = objLocator.ConnectServer
(PCName, "Root\DEFAULT")
If Err.Number <> 0 Then
MsgBox "An error occurred while connecting to
the remote workstation.", vbCritical, "Error!"
Err.Clear
Exit Sub
End If
Set objRegistry = objService.Get("StdRegProv")
sPath
= "Software\Microsoft\Windows\CurrentVersion\Run"
result = objRegistry.EnumKey(HKEY_USERS, "",
arrSubKeys)
If Err.Number = 0 Then
For Each strSubKey In arrSubKeys
If Right(strSubKey, 8) <> "_Classes" Then
' objRegistry.GetStringValue HKEY_USERS,
strSubKey & "\" & sPath, strValue
' MsgBox strSubKey & vbCrLf &
strValue 'String(Len(strSubKey), "-")
varTemp = strSubKey & "\" & sPath
GetNCheck HKEY_USERS, varTemp
End If
Next
Else
MsgBox "Error " & Err.Description
End If Tag: vbscript-msql2k Tag: 150034
What is the most efficient way to check sql server available before
read/writes to db.
In need to notify admin sql server offline/online for 30 servers.
Don