Is it possible to set the system time from the web browser?
I need to synchronize the system time on the client computer with a server by the web browser
Is it possible to do by some VBScript or is it possible to run such script in a WSH launched by the web browser? Tag: Setting the time? Tag: 157228
Create a Simple List of AD Users to .csv File
I need to create a list of users: FirstName; LastName; PhoneNumber;
Department for an OU. I need to be able to filter that PhoneNumber is
<>Null
I know that I did this last year - but ....
Thanks Niel Tag: Setting the time? Tag: 157227
Detecting Blank CD-RW
The following code results in "Drive D: is not read (no media present)" whenever a BLANK (brand new) CD-RW is in the drive. How can I detect that a blank CD-RW is in the drive? There is no "IsBlank" property that I can find. I'm trying to determine if there is anything on the media and, if there is, the script erases the media (using CreateCD). Note that there is nothing wrong with the media (I've tried several disks, and can write on them fine. Once I've written on them, my script detects the media in the drive)
'*** Make sure CD-RW drive read
TestDrive = "D:
Set TestDriveObject = fso.GetDrive(TestDrive
If Not TestDriveObject.IsReady the
PromptStr = "Drive " & TestDrive & " is not ready (no media present)
PromptStr = PromptStr & CrLf & "Script terminated due to error
PromptButtons = vbOKOnly + vbCritica
ScriptExitCode = 9
TerminateScrip
End if Tag: Setting the time? Tag: 157219
Opening a new browser, not a window
I have a need to open OWA in a new browser, not a new window.
How can I programatically open a new browser session to a web page below
http:\\<servername>\exchange\<userid
I need this to be in a new browser, not another page, because the password and userid get cached in the browser session. If I open in a new page, the credentials get saved until that session is closed. If I open in a new browser, then when that session/Page is closed, the credentials are cleare
I'm not a programmer and could not find anything about this on the Microsofts help page
Thanks in advanc
Gordo Tag: Setting the time? Tag: 157218
Error en script .vbs
Hola, saludos.
He hecho dos scripts en vbs para borrar dos grupos de carpetas (folders)
El primero funciona correctamente, pero al ejecutar el segundo se genera
un error en línea 2, caracter 1, error "permiso denegado", código de
error 800A0046, y origen "error de Microsoft VBScript en tiempo de
ejecución".
Los scripts son los siguientes:
Set BorraRuntime = CreateObject("Scripting.FileSystemObject")
BorraRuntime.DeleteFolder "D:\Incredimail\Datos de
Incredimail\IM\Runtime\*.*"
Set BorraAttachments = CreateObject("Scripting.FileSystemObject")
BorraAttachments.DeleteFolder "D:\Incredimail\Datos de
Incredimail\IM\Identities\{F7E4AEE0-8C88-4707-BA5E-680B32381A99}\Message
Store\Attachments\*.*"
¿Cuál puede ser el error? Se trata simplemente de borrar dos grupos de
carpetas, pero no he conseguido hacerlo.
Gracias por la ayuda. Tag: Setting the time? Tag: 157216
CreateObject("Microsoft.XMLhttp")
Hi to all,
does anyone know where to find a referende-guide for the
"Microsoft.XMLhttp"-object?
and how to save a picture-file from a (knowen) internet-address?
thank's to all for helping.
Marcus Tag: Setting the time? Tag: 157209
createobject("adodb.command")
Hello,
Can some one tell me where I am going wrong. I am trying to execute a
stored procedure using vbscript. I can execute them in vb6, but cant get it
to work using active server pages.
The problem is : Each time i try to create a command object I get the
error - Activex cant create object ADODB.command. When I create an
ADODB.recordset the compiler passes this.
i.e
****************************************************************************
********
PAGE1. ASP
****************************************************************************
********
<!-- METADATA TYPE="typelib" FILE="C:\Program Files\Common
Files\System\ado\msado15.dll" -->
<!-- #INCLUDE FILE="PAGE2.asp" -->
<SCRIPT LANGUAGE = VBSCRIPT>
sub cmdButton1_onclick
test()
end sub
</SCRIPT>
<HTML>
<%
Response.write "<INPUT TYPE = button Name = cmdButton1 Value = Add>"
%>
</HTML>
****************************************************************************
********
PAGE2.ASP
****************************************************************************
********
<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common
Files\System\ado\msado15.dll" -->
<SCRIPT LANGUAGE="VBSCRIPT" >
Function test()
dim objCommand
Dim adoStreamQuery
'Pass this ok
Set obJRs = CreateObject("ADODB.Recordset")
'Fail - Error: Activex component can not create object
ADODB.command
Set objCommand = CreateObject("ADODB.Command")
end function
</script>
Thanks... Tag: Setting the time? Tag: 157203
mandatory fields
When creating new objects in ADSI from a class, I can see what properties
are mandatory by browsing AD with ADVW, by use of the schema management
tool, or by refering to MSDN Library. MSDN does provide the most
information.
Still, it is not clear to me how one can tell, when instantiating a new
object, which of the mandatory fields must be populated by the script writer
and which the system will populate (such as Object-SID).
Are there any general guidelines I might share with a student?
Thanks,
JB Fields Tag: Setting the time? Tag: 157199
Unicode OpenTextFile and Search Problem
I have written a script in vbs that basically opens a set of selected files,
performs a search on each file and replaces each occurrence of a string with
a different string. This works fine on ASCII files.
However the original files that I will be searching are Unicode files. With
these files, even though I have stated in the OpenTextFile command that the
files are to be opened as Unicode, the search finds nothing. I have
confirmed that the files are unicode by checking the first two characters
are ASCII 255 and 254. If I copy the contents of the Unicode file to a new
text file the search works fine.
What is my problem? Do I have to have a search string that is written in
Unicode? I'm using RegExp to do the search. I do not want to save or convert
the original files.
I thought I'd find a solution in the newsgroups quickly on this one. But
have had no success yet. Please help as the script is fully functional
except for this "simple" problem.
Thanx in advance.
Rob Tag: Setting the time? Tag: 157197
Help with script
I would like to determine if a machine is a workstation or a server. I am running the script below, but it keeps erroring out, by saying "<machine> does not have wmi installed"
' Specify NetBIOS name of the computer
strComputer = "\\image1
' Trap the error if WMI is not installed, or if the compute
' is off line
On Error Resume Nex
Set objWMIService = GetObject("winmgmts:"
& "{impersonationLevel=impersonate}!\\"
& strComputer & "\root\cimv2"
If Err.Number <> 0 The
On Error GoTo
Wscript.Echo strComputer & " does not have WMI installed
Els
On Error GoTo
Set colComputers = objWMIService.ExecQuery
("SELECT * FROM Win32_ComputerSystem"
For Each objComputer In colComputer
intRole = objComputer.DomainRol
Select Case intRol
Case
strRole = " is a standalone workstation
Case
strRole = " is a member workstation
Case
strRole = " is a standalone server
Case
strRole = " is a member server
Case
strRole = " is a backup domain controller
Case
strRole = " is a primary domain controller
End Selec
Wscript.Echo strComputer & strRol
Nex
End I Tag: Setting the time? Tag: 157195
Find Particular Shortcut
The following code displays all shortcuts on a PC along with the path
and target. How can I modify this to find a specific shortcut? I
can't seem to find any documentation on this.
Set colItems = objWMIService.ExecQuery("Select * from
Win32_ShortcutFile",,48)
For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Target: " & objItem.Target
Next Tag: Setting the time? Tag: 157193
Matching over multiple lines
Hello,
How would I match the following body of code (from { to })?
void foo ()
{
some code here
some more code here
and yet, still more code here
}
Thanks in Advance,
Sean Tag: Setting the time? Tag: 157185
Matching {'s in VBSCript
Hello,
Given the following:
ifdef _cplusplus
extern "C"{
#endif
void foo1 () { ... somecode ...}
void foo2 () { ... somecode ...}
ifdef _cplusplus
}
#endif
beginning code segment, I would like to be able to format the code to
the following:
ifdef _cplusplus
extern "C"{
#endif
void foo1 ()
{
...
somecode
...
}
void foo2 ()
{
...
somecode
...
}
ifdef _cplusplus
}
#endif
I have tried the several regular expressions:
[^extern.*""C"".*]{
but it captures a character previous to the brace, is there a way to
just match the brace?
Thanks,
Sean Tag: Setting the time? Tag: 157184
Error checking vbscript functions
I am trying to build a library of vbscript functions and I would like to build in error checking but I am running into a problem, or at least something I don't understand. I want the function to verify the variables it is passed before it begins. The first thing I want to check is that all the variables are specified, but when I tried to test for missing variables I found the error seems to be generated when the function is called but before control is passed to it
' Sample program to demonstrate CheckFreeSpace Functio
if (CheckFreeSpace ("c:", 1200000)) the
wscript.echo "ROOOOOOOMMMMMMMY!
els
wscript.echo "tight
end i
' End Sample program to demonstrate CheckFreeSpace Functio
Function CheckFreeSpace(drvPath, MBNeeded
' usage: if (CheckFreeSpace("c:", 12)) then something
' checks for free space. If the free space on the drive exceeds the
' amount requested returns true. Otherwise it returns false
' the MBNeeded is megabytes needed. d.FreeSpace returns byte
' so we devide by 1,000,000 to get megabytes, and yes I know abou
' using 1024, but 1,000,000 gets the same number as the DIR command
Dim fso, d,
Set fso = CreateObject("Scripting.FileSystemObject"
Set d = fso.GetDrive(fso.GetDriveName(drvPath)
if (d.FreeSpace/1000000 > MBNeeded) the
CheckFreeSpace = Tru
els
CheckFreeSpace = Fals
end i
End Function Tag: Setting the time? Tag: 157182
Emulating IE6???
Hi All
I have written a script to test the source code returned by a "local box" web site. The idea being that if the site fails the script will pick it up and take corrective action. The only problem I have is that some of the newer site designs require IE6 in order to function
When I run the script against these sites they either fail or redirect to thier "old browser" sections
Is there a way I can get vbscript to emulate the IE6 browser, hence resolving this issue
Many thanks,
Aaron Tag: Setting the time? Tag: 157178
Read from txt file and write AD
Hi,
Can anyone help creating a script to:
Ex:
read txt file with two columns "username", "telephone"
search ad for the username
if find write de telephone (if already exists replace if diferent, or skip
if equal)
else
skip
Tanks
Pedro Tag: Setting the time? Tag: 157177
Colour & Move ?
Hi
I have the tabbed pages up and running but I cant find a way t
control the colour of the pages, I can change the colour of th
background behind the pages and the forecolour ( Font) but not th
pages themselves ?
For Buttons I would change the style to Graphical but there isnt tha
option for the tabbed page
I tried to use the MouseDown and MouseMove to move the Form withou
the title bar but it just jumped all over the place I had no contro
over it. I used the lines
Form1.Move x,
AND
Form1.Move(x-Form1.Width/2),(y-Form1.Height/2
I want to be able to click on it and drag it to another position, An
ideas :- Tag: Setting the time? Tag: 157176
script to show physical and virtual memory available
I would like to run script to show the memory usage on a window 2000 server.
Then I would use the schedule to run it regularly to keep track of the
memory usage.
Please advise if I can do it.
Thanks.
JW. Tag: Setting the time? Tag: 157173
Internet Options
There is a service Win32_NTEventLogFile in vbscript by which we can
clear,add, save events.
Is there any service for Internet Options(in control panel).
Here i want to clear forms and passwords.
waiting for reply Tag: Setting the time? Tag: 157172
Determine Workstation or Server?
How, using VBScript, would I be able to determine if a computer is a WS or Server in AD? I have a script (WSH) that queries each computer in AD. If a computer is a Server, I would like certain code executed on it. I would like to use it in "If <server> then". Is there some type of property that would tell me this? Please let me know. Tag: Setting the time? Tag: 157163
Job Open in Brooklyn, NY
hi all,
there is a job opening for a web developer and designer in brooklyn NY.
Please send all resumes to
jobs AT skynet22.com
replace the " AT " with @.
good luck to all candidates
rafael Tag: Setting the time? Tag: 157162
enumerating Mapped drives
My script to output mapped drives works on win2k and NT but not on XP.
What changed?
Const INPUT_FILE_NAME = "C:\Scripts\Computers.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)
For Each strComputer In arrComputers
On Error Resume Next
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colDisks = objWMIService.ExecQuery _
("Select * from Win32_LogicalDisk")
If Err.number = 0 Then
On Error GoTo 0
Wscript.Echo strComputer & VBCrLf
For each objDisk in colDisks
if objDisk.Description = "Network Connection" then
Wscript.Echo "DeviceID: " & vbTab & objDisk.DeviceID
Wscript.Echo "Name: " & vbTab & objDisk.Name
end if
Next
else
if strComputer <> "" Then
wscript.stdout.writeLine strComputer & " not found" & vbCrLf
End If
end if
Wscript.Echo VBCrLf & vbCrLf
Next Tag: Setting the time? Tag: 157160
vbscript syntax
Where can I learn the code/syntax to write vbscript?
I suppose any coding in vb 6.0 is acceptable to vbscript.
I dont see books on VBSCRIPT, but ASPNET, JAVASCRIPT, PERL and so on. It
may appear that ASPNET is really VBSCRIPT. Is it?
Perhaps a book on WSH will detail samples in VBSCRIPT.
Can one of you help answer the question?
alan
--
alan Tag: Setting the time? Tag: 157150
Sending email HTML for Lotus Notes
How can I send a email HTML for users Lotus Notes, with format MIME
I already tried send and for users Outlook, the emails shows in the body of email, but for users Lotus Notes, the email not shows correctly, its shows only text and not HTMLs
Someone knows whats hapenning
tks Tag: Setting the time? Tag: 157145
Removing spaces for environment variable
I have the following in a batch file:
Set %1=<value>
ex. Set %1=TECRA S1
This value is written using a vb script that detects the system type
in the BIOS. Now, I'm then using this value to set an environment
variable, however, environment variables must not contain spaces so
that I can use IF GOTO statements in my batch file. I need an
addition to my vb script that will remove any spaces OR replace them
with underlines (which ever is easier) before writing the result to
the batch file. Here's an example of my vb script:
--->8----->8---
Dim I, fso, MyFile, s(200), item
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile("c:\temp\detect.bat", True)
Set SystemSet = GetObject
("winmgmts:").InstancesOf("Win32_ComputerSystem")
for each item in SystemSet
MyFile.WriteLine "Set %1=" & trim(item.Model)
next
MyFile.close
--->8----->8---
You'll notice that the "Set %1=" value will always be constant and
that it MUST contain a space therefore requiring the script to only
modify the value after the = sign.
I appreciate any help you can offer. Tag: Setting the time? Tag: 157140
New Line with Response.Write
Hello all. I'm sure this is an easy one but can't get it to work. I
have a page that is pure ASP vbscript with no html that I am using to do
some database checks. I am using the Response.Write to write out the
info I need but need to start a new line with each Response.write. I
have tried vbcrlf and <br> and Chr(13)&Chr(10) but it doesn't work.
Please help me...
SusanC
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: Setting the time? Tag: 157129
"Transaction deadlocked" problem
Greetings
I have a script that establishes a connection to an SQL database and creates severa
recordset objects via Select statements. I only want to extract data -- no updatin
needed. But I'm experiencing the following error condition
Transaction deadlocked on lock resources with another process and has been chose
as the deadlock victim. (Code: 80004005
I tried the following syntax on my recordset Opens
objRec.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnl
But this gave me a syntax error
Arguments of the wrong type, out of acceptable range, or in conflict with one another
Then I tried eliminating the ad* parameters entirely, which according to a VB manua
should default to a forward-only, read-only recordset. But I still get the "deadlock
condition
Can anyone offer any help on this? Would appreciate greatly
Thanks
To Tag: Setting the time? Tag: 157127
Control page refreshing
I need to add a button to a page that can enable or disable page auto refreshing. Can anyone help me get this started
1. I want the page to refresh every 10 seconds by default and display a button "Stop Refresh
2. When user clicks button, it stops the auto refresh and button now reads "Start Auto Refresh
and so on. I am currently using only a meta tag for refreshing but cannot control it.
Thank
C Tag: Setting the time? Tag: 157126
ODBC connections
Is there any way to create ODBC connections using vbscript? I don't want to use the gui for remote sites.
Thanks
Lou Tag: Setting the time? Tag: 157123
Exe file stopped working from ASP script
Using IIS 5.0 under Win2k.
I have ASP code which uses WScript.Shell object to run an exe file on
the server. This code use to work fine but we just rebuilt the server
and it stopped working.
The server is internal server and Anonymous Access has been disabled.
It only uses windows authentication.
The exe file copies image from other server to local folder and 3
window user groups has been given full permission to this folder.
When I logon as an authenticated user and loads the page it doesn't
executes the exe file any more.
If I run the same command line locally on the server using one of the
authenticated user login, it works fine.
Same code and same exe is still working fine on different server.
Any help would be greatly appreciated.
Thanks a lot. Tag: Setting the time? Tag: 157121
Page Refreshing
I need to add script to a page so there can be a button on the top that does the following
1. The page initially auto refreshes every 5 seconds and the button displayed at the top of the page reads "Stop Auto-Refresh
2. If you click on stop Auto-rrefresh, the page no longer refreshes and the button reads "Turn Auto-Refresh On
Can anyone help me get started
Thanks!! Tag: Setting the time? Tag: 157119
Multi-folder update
Okay, here's what I'm trying to do;
I have 3 folders in the root of my site;
/upg - contains upgraded file's
/folder1
/folder 2
Now, what I'm wanting to do is copy the files from the "upg" folder, to
every sub-folder in "folder1" and "folder2". I wrote the code below to
acheive this, but for some reason, it's additionally copying all of the
folders from the first folder, to the second (i.e. the contents of folder1
to folder2..... which it is not supposed to be doing).
'// Begin
<%
'// shouldn't really be necessary but it keeps erroring if there's no
timeout specified.
server.scripttimeout = "5000"
dim fso
set fso = createobject("scripting.filesystemobject")
'// Set to folder1, is changed to folder2 when folder1 is complete
set flds = fso.getfolder(server.mappath("folder1"))
for each fld in flds.subfolders
fso.Copyfolder Server.MapPath("upg\"), fld.path, true
next
set fso = nothing
set flds = nothing
set fld = nothing
response.write "Done"
%>
'// End
--
Regards
Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk
Keeping it FREE!
Personal favourites
Practically Nerded - http://mvps.org/PracticallyNerded/
Bugs, Glitches n stuff - http://mvps.org/inetexplorer/Darnit.htm
Calendar of Updates - http://www.dozleng.com/updates/index.php?&act=calendar Tag: Setting the time? Tag: 157118
Help with a script dealing with services
The client is Windows XP SP1.
In the properties of the service, under the recovery tab, I want to
modify the following:
first failure: Restart the service
second failure: restart the service
subsequent failure: restart the service
Can this be done with vbs scripting?
--
Eric Sabo
NT Administrator Tag: Setting the time? Tag: 157111
Free Currency Conversion Web Services?
Is anyone aware of free currency conversion web services? I have an
application that the user must enter the currency conversion rate and if
possible I'd like them simply to pick the type of currency (and then
retrieve the latest conversion information).
Any help would be greatly appreciated.
BBB Tag: Setting the time? Tag: 157110
How to get the current folder?
How can you get the current folder within a vbscript-program?
I worked around this problem by creating a filesystemobject with the
filename of my program and split the file-path... but if someone was
to change the filename of my program, this wouldn't be working
anymore...
Any suggestions? Tag: Setting the time? Tag: 157105
Crete exel charts with asp
Hi
I found this code to crete excel charts, with asp, but Im having problems creating custom type charts, I think I need the gallery constants, but I don't know where to find. Can someane take alook at the code and advise
Thanks
Alban
Code asp and html source
<%@ LANGUAGE="VBSCRIPT" %><%
Option Explici
'--------------- WEB SITE: YOUR WEB SITE NAME ---------------
' File Name: 10MinChart.as
' Purpose
' Genearate a Chart using Microsoft Excel in an ASP pag
' Arguments
' Comment
' Author: Rama Ramachandra
' Imperium Solution
' http://www.imperium.co
' Internet: rama@imperium.co
' Date Created
' 8/29/200
' Modification History
'---------------------------------------------------------------------
Dim mintPass, mstrFileNam
Dim i ' misc variabl
Randomize Time
mintPass = Request("pass"
Select Case Int(mintPass
Case
HandleRepeatVisi
End Selec
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><TITLE>Create "Excel"lent Charts with ASP</TITLE><STYLE TYPE="text/css"><!-- /
BODY
font-family: Verdana, Arial, Helvetica, Sans Serif
font-size: 10pt
TH
font-family: Verdana, Arial, Helvetica, Sans Serif
font-size: 10pt
font-weight: bold
background-color: #DDDDDD
TD
font-family: Verdana, Arial, Helvetica, Sans Serif
font-size: 10pt
background-color: #EEEEEE
// --></STYLE></HEAD><BODY BGCOLOR="#FFFFFF"><BASEFONT FACE="Verdana, Arial, Helvetica, Sans Serif" SIZE="2"><FORM ACTION="10MinChart.asp" METHOD="post"><INPUT TYPE="hidden" NAME="pass" VALUE="1"><TABLE BORDER="0" CELLPADDING="5" CELLSPACING="2" WIDTH="750"><TR><TD ALIGN="CENTER" VALIGN="TOP" COLSPAN="3"><STRONG>Create "Excel" lent Charts with ASP!</STRONG></TD></TR><TR><TD ALIGN="CENTER" VALIGN="TOP" COLSPAN="3"><STRONG>- by Rama Ramachandran</STRONG>  
<FONT FACE="ARIAL" SIZE="1"><A HREF="10MinChart.Zip">Get the Code for this page here</A>.</FONT></TD></TR><TR><TD ALIGN="CENTER" VALIGN="TOP">Stock Price for:</TD><TD ALIGN="LEFT" VALIGN="TOP"><INPUT TYPE="text" NAME="co" SIZE="25" VALUE="Microsoft"></TD><TD ALIGN="CENTER" VALIGN="MIDDLE" ROWSPAN="13"><% If mstrFileName <> "" The
Response.write "<IMG SRC=""/graficos/chartExcel2/" & mstrFileName & """>"
Els
Response.write "<IMG SRC=""spacer.gif"" WIDTH=""100"" HEIGHT=""1"" BORDER=""0"">
End I
%></TD></TR><
For i = 1 to 12 %><TR><TD ALIGN="LEFT" VALIGN="TOP">Date: <%= FormatDateTime(i & "/01/99", 2)%></TD><TD ALIGN="LEFT" VALIGN="TOP">$ :<INPUT TYPE="text" NAME="v<%= i%>" VALUE="<% If mintPass=1 Then Response.Write Request("v" & i) Else Response.Write Int((100)*Rnd+1) End If %>" SIZE="10" MAXLENGTH="5"></TD></TR><
Next %></TABLE><INPUT TYPE="submit" NAME="cmd" VALUE=" Generate Chart"></FORM></BODY></HTML><
Sub HandleRepeatVisit(
Dim xlapp ' Our Excel Ap
Dim wb ' Our Workbook within the Excel Ap
Dim ws ' Our Worksheet within the Workbook
Dim crt ' The chart objec
Dim SourceRange ' The Source Range for the chart objec
Const xlWorkSheet = -4167
Const xlLineMarkers = 6
Const xlCombination = -411
Const xlColumn =
Const xlBuiltIn = 2
Const xlUserDefined = 2
' -- Create an instance of Excel Applicatio
Set xlapp = Server.CreateObject("Excel.Application"
' -- Create a new workboo
Set wb = xlapp.Workbooks.Add(xlWorksheet
' -- Grab the first worksheet of the new workboo
Set ws = wb.Worksheets(1
' -- Insert the data the user requeste
' -- First, the titl
ws.Range("A1").Value = Request("co") ' -- defaults to "Microsoft
' -- Then the data in two vertical column
For i = 1 To 1
ws.Range("A" & i + 1).Value = FormatDateTime(i & "/01/99", 2
ws.Range("B" & i + 1).Formula = "=" & Request("v" & i)
Nex
' -- Set our source range
Set SourceRange = ws.Range("A2:B13"
' -- Create a new Chart Objec
Set crt = ws.ChartObjects.Add(20, 20, 300, 200
' -- Generate the Chart using the ChartWizar
' -- Syntax is:
' -- crt.Chart.ChartWizard Source:=SourceRange, gallery:=xlLine(4), PlotBy:=xlColumns(default),
' -- categorylabels:=1, serieslabels:=0, HasLegend:=2, Title:="Company Stock Value"
crt.Chart.ChartWizard SourceRange, 4, , 2, 1, 0, 2, Request("co") & " Stock Value"
' -- Configure the Chart
crt.Chart.ChartType = xlLineMarkers
crt.Chart.SeriesCollection(1).Name = "Sheet1!R1C1"
crt.Chart.HasTitle = True
crt.Chart.Axes(1, 1).HasTitle = True
crt.Chart.Axes(1, 1).AxisTitle.Characters.Text = "Months"
crt.Chart.Axes(2, 1).HasTitle = True
crt.Chart.Axes(2, 1).AxisTitle.Characters.Text = "Stock Price"
' -- Determine the name to save this chart as. Use the current Seconds value, overwriting previous
' -- ones
mstrFileName = "junk" & Second(Now()) & ".jpg"
' -- Save the chart on web server
crt.Chart.Export Server.Mappath("/graficos/chartExcel2/") & "\" & mstrFileName, "jpg"
' -- Fool Excel into thinking the Workbook is saved
wb.Saved = True
' -- Set all objects back to nothing
Set crt = Nothing
Set wb = Nothing
' -- Quit Excel to conserve resources
xlapp.Quit
Set xlapp = Nothing
' -- Make sure the Image is not cached but is loaded fresh from the web server
Response.AddHeader "expires","0"
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control","no-cache"
End Sub
%> Tag: Setting the time? Tag: 157102
integer ?
Hi
I need to use the "If" to check a number, I want to check a number i
an integer, if it isnt I want to go back and generate another numbe
if it is I want to leave the sub
This is a general description of what I am trying to do,
I have tried " If num <> Int Then ", But this doesnt work ca
anyone tell me the correct statement I should use
Thanks Tag: Setting the time? Tag: 157098
Migrating Printers
I have zero experience with VB, and I have figured out a way to migrate printers by grabbing a couple of values from the Registry, but it doesnt work out so good if i use the whole key. can anyone help out with grabbing specific values from a machine and exporting them to a file such as "username.reg". TIA
REGEDIT
[HKEY_CURRENT_USER\Printers\Connections\,,sdprint1,HP4100TN-21
"Provider"="win32spl.dll
"Server"="\\\\sdprint1
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices
"\\\\sdprint1\\HP4100TN-21"="winspool,Ne04:
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts
"\\\\sdprint1\\HP4100TN-21"="winspool,Ne04:,15,45 Tag: Setting the time? Tag: 157092
paste html code into excel cell?
Anybody can help me?, I need take an string that is HTML code and paste by
code into an excel cell. The code must be shown interpretate, thus in the
same way that if you go to the browser select a pieze of web page and select
copy, go to an excel book and paste it!, anybody have an idea?
Thanks Tag: Setting the time? Tag: 157081
Path info for VBscript from HTM page
I would like to run a vbscript from a html page on my website.
Being new to this game I made something like:
Set fso = CreateObject("Scripting.FileSystemObject")
set f=fso.opentextfile("mytext.txt", 8, true)
f.writeLine "this is new text"
f.close
This script was placed in a html file (under Frontpage), located in folder
c:\my documents\myweb.
The script runs fine, but the file mytext.txt is placed in the folder
C:\Documents and Setting/MyName, when I run the script under Frontpage, and
it is put on my Desktop when I run the script from the HTML file. When I
upload the html file to my website and run the script I get an error.
Neither is what I want, because basically I want to access (for read and/or
write) a textfile located in the folder with my html document with the
script in it, be it local on my PC or on my Website.
So, if my_file.html (with a script in it) how do I retrieve its absolute or
relative path, when it can sit on my PC or the Website with my provider
Thanks for any suggestions.
Ko Vijn Tag: Setting the time? Tag: 157079
vb script to VB
H
I need to make a vb script to EXE. But searching the web a few days, advise is to import the script to VB
Anyone can advise how ? And any tools to do it
Thank Tag: Setting the time? Tag: 157075
Error Handling
Below is my practice sript to display domain names. computers therein and
computer roles. However, the error handling doesn't appear to work...or I
don't understand the correct implementation. Probably the latter.
The computers listed may not acutally be on the network and I thought the
error subroutine would capture and display a message, then move on to the
next iteration..
Can one of you experts give me a correction to this? Thanks!
'***********************************************************************
'Script Name: show_domain_info.vbs
'***********************************************************************
'Initialization Section
Option Explicit
On Error Resume Next
'Variables
Dim colDomains, colRole
Dim objDomain, objUseDomain, objWMIService, objRole
Dim strComputer
Dim strComputerRole
'Constants
Const SPACES = " "
'Main Processing Section
'Display to console the list of domains
'Find all the computers in each domain and write out to the console the
'computer name, domain name, domain role
'Intialize & Bind to the provider
strComputerRole = Spaces
Set colDomains = GetObject("WinNT:")
For Each objDomain in colDomains
Set objUseDomain = GetObject ("WinNT://" & objDomain.Name)
'This is supposed to display an error message if the value is not Zero. The
Subroutine is below.
ErrorHandler
objUseDomain.Filter = Array("Computer")
ErrorHandler
For Each strComputer In objUseDomain
DetectRole
Next
Next
'Subroutines
Sub DetectRole
'Next line for trouble shooting. remarked out.
'Wscript.Echo "in DR " & "Domain= " & objUseDomain.Name & " ComputerName= "
_
& strComputer.Name & "before"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer.Name & "\root\cimv2")
ErrorHandler
Set colRole = objWMIService.ExecQuery ("SELECT * FROM
Win32_ComputerSystem")
For Each objRole in colRole
Select Case objRole.DomainRole
Case 0
strComputerRole = "Standalone Workstation"
Case 1
strComputerRole = "Member Workstation"
Case 2
strComputerRole = "Standalone Server"
Case 3
strComputerRole = "Member Server"
Case 4
strComputerRole = "Backup Domain Controller"
Case 5
strComputerRole = "Primary Domain Controller"
End Select
WriteReportLine
Next
'Next line for trouble shooting. remarked out
'Wscript.Echo "out DR " & "Domain= " & objUseDomain.Name & " ComputerName= "
_
& strComputer.Name & " Role= " & strComputerRole & "after"
End Sub
'Check for value Not Equal to zero and display message, clear error.
Sub ErrorHandler
If Err.Number <> 0 Then
Wscript.Echo objUseDomain & " " & Err.Description
Err.Clear
End If
End Sub
'Write Report line to console and clear variable for next iteration
Sub WriteReportLine
Wscript.Echo "Domain= " & objUseDomain.Name & " ComputerName= " _
& strComputer.Name & " Role= " & strComputerRole
strComputerRole = SPACES
End Sub Tag: Setting the time? Tag: 157074
making .bat file an .exe file
Forgive me if this is the wrong ugroup. I am trying to make a
self-extracting installation file (of a VBA project), and the installer
software demands an executable file (with extension ".exe"). I have a .bat
file that does all I need it to do (as well as a .xls file), but don't know
how to make that .bat file code "become" an .exe file. Being a complete
novice, I don't even know how ridiculous this question is, but can anyone
help me?
TIA, guys. Tag: Setting the time? Tag: 157069
Tabbed Pages ?
Hi,
I would like to create a program that has a few app's in one but are
shown by tabbed windows, how do I do this in VB6,
The other thing is how to make a small program form moveable without
the title bar, because it seems that it uses the title bar as a
handle and when I remove it , it becomes immoverable.
Thanks :) Tag: Setting the time? Tag: 157068
retrieving an ip address
Hey all
is there a way to retrieve the ip address that is being broadcasted by my router to the internet
ari Tag: Setting the time? Tag: 157065
WMI enumerate printers in ASP page missing shared printers
Hello
If I use the following vbs script on a Win XP machine I get all the printers no proble
strComputer = ".
Set oSvc = GetObject("winmgmts:\\" & strComputer & "\root\cimv2"
Set Printers = oSvc.Get("win32_printer").Instances
for each printer in Printer
WScript.Echo "Printer: " & printer.name & vbTab & "Default? " & printer.Defaul
nex
If I do the same thing in ASP I only get local printers. I don't get printers that are shared from another machine that have drivers loaded on the machine I run the asp script on. Here is the code
<
strComputer = ".
Set oSvc = GetObject("winmgmts:\\" & strComputer & "\root\cimv2"
Set Printers = oSvc.Get("win32_printer").Instances
for each printer in Printer
Response.Write "Printer: " & printer.name & vbTab & "Default? " & printer.Default & "<br>
nex
%
I have tried all kinds of security permissions settings to no avail and am stumped at this point. Any suggestions Tag: Setting the time? Tag: 157059
Getting computer name of user connecting to XP via remote desktop
Hi,
I need to complete a script that runs at login when a user on the LAN RDP's
to an XP Pro PC using remote desktop. What I am trying to do is to update a
key in the registry of the XP PC being accessed with an identifying
characteristic of who is connected to it, such as the IP address or the
computer name of the machine the person is coming in from, or his/her user
name. Whatever I try just returns the local computer name and local username
of the login at the XP RD session (which is always the same regardless of
who connects to it).
Any ideas?
Thanks
Gary Tag: Setting the time? Tag: 157051
code for a tab in a string?
Hello,
in the code on my website I use the following code:
dim strText
strText = "Hello," & vbcrlf & "I'm Fredeirk" & " I live in Belgium"
I use the vbcrlf to enter a new line and but before the text 'I live in
Belgium', I want some opening, now I use some spaces.
Does someone now how to enter a tabulator (tab) in the code instead of some
spaces?
kind regards,
Frederik Tag: Setting the time? Tag: 157047
Is it possible o sync the time with another machine via VBZ - like the
NET TIME command??