Reading a registry Value
Hello
I was wondering if it's possible to use VBscript as a means to get a value from the registry and if not, how it can be done using VB6
Thanks a lot
-Dany Tag: Grey font Tag: 151491
Changing Numlock state
Hey all,
I want to change the default Numlock state on our PC's
I use this script
'
' Enable NumLock for NON portables
'
strKeyPath = "Control Panel\Keyboard"
strEntryName = "InitialKeyboardIndicators"
strValue = "2"
oReg.SetStringValue &H80000001,strKeyPath,strEntryName,strValue
strKeyPath = ".default\Control Panel\Keyboard"
strEntryName = "InitialKeyboardIndicators"
strValue = "2"
oReg.SetStringValue &H80000003,strKeyPath,strEntryName,strValue
The Current User setting is changed, but not when the PC starts.
I can't seem to change the Default User setting...
What is wrong?
Marc Tag: Grey font Tag: 151490
help with modifying select folder code
Hi,
I have this vbscript function for selecting a folder. It works well,
but i can not browse computers
on the network to select a folder. Can someone help me modify it to
allow this on a windows box.
Thanks so much!
Chuck
Const ValueRoot = "&h17"
Const sStartFolder = 17 'This value specify folder/browsing options
Call BrowseForFolder("Choose a folder", &h17, sStartFolder)
Function BrowseForFolder(strPrompt, BrowseInfo, root)
On Error Resume Next
Dim oShell, oFolder, intColonPos, oWshShell
Set oShell = CreateObject("Shell.Application")
Set oWshShell = CreateObject("WScript.Shell")
Set oFolder = oShell.BrowseForFolder(0, strPrompt, BrowseInfo, root)
BrowseForFolder = oFolder.ParentFolder.ParseName(oFolder.Title).Path
If Err.Number > 0 Then
BrowseForFolder = Null
If oFolder.Title = "Desktop" Then
BrowseForFolder = owshshell.SpecialFolders("Desktop")
End If
intColonPos = InStr(oFolder.Title, ":")
If intColonPos > 0 Then
BrowseForFolder = Mid(oFolder.Title, intColonPos - 1, 2) & "\"
End If
End If
PathFileBrowse = BrowseForFolder
End Function Tag: Grey font Tag: 151486
Accessing Session/Application variables in Global.asa from a VBS file???
Hi Guys,
My ASP Application has a Global.asa where some settings
(Session/Application Variables) are stored. These are used by some of
my ASP Pages in the application.
Now, my task is to write a scheduler program to send some reminders.
I have already implemented this scheduler program using a .VBS file on
the server. This .VBS file will be called from the Windows Scheduler.
In my VBS file, I need to access certain values of Session/Application
variables from Global.asa. How can I get these values in VBS file?
Regards,
Kamlesh Tag: Grey font Tag: 151485
Updating users
I need to build a script that will run when the pc is started up to delete
all local users except administrator in a win2000 professional. The user
somehow can run some hack program to add in administrative user even though
he is a regular users.
If possible I would like to update the administrator password as well, in
case his hack can change the password.
I don't know if this is do-able.
Please advise.
Thanks.
JW. Tag: Grey font Tag: 151484
run EXE from a VBS custom action
I need to run an exe file from my VBScript.
Should be simple, I know, but the script is run as a custom action from an
MSI installer, so there is no WSH and no WScript object.
How can I run an exe from my script?
Is there a way to make my script wait until the exe finishes (even if it is
a GUI exe)?
Jens Tag: Grey font Tag: 151479
can U make this button work
I have been working on this problem for weeks.
I just want the script to pass the form data to itself when the button is
clicked and continue with the next function.
<----------------------------------------------------->
set objExplorer = CreateObject("InternetExplorer.Application")
Do While (objExplorer.Busy)
Loop
objExplorer.Navigate "about:blank"
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 640
objExplorer.Height = 480
objExplorer.Left = 0
objExplorer.Top = 0
objExplorer.Visible = 1
set objDocument = objExplorer.Document
objDocument.Open
objDocument.Writeln "<FORM NAME='Form1'>"
objDocument.Writeln "<B>Choose the areas you are interested in</B>"
objDocument.Writeln "<BR><INPUT TYPE=CHECKBOX NAME='chkIS'> Information
systems"
objDocument.Writeln "<BR><INPUT TYPE=CHECKBOX NAME='chkSE'> Systems
integration"
objDocument.Writeln "<BR><INPUT TYPE=CHECKBOX NAME='chkSA'> System
administration"
objDocument.Writeln "<BR><INPUT TYPE=CHECKBOX NAME='chkMgmt'> Management"
objDocument.Writeln "<BR><INPUT TYPE=BUTTON NAME='Button1'
VALUE='Continue'>"
objDocument.Writeln "</FORM>"
Sub Button1_onclick
Dim Selections, Count
Count = 0
If Form1.elements(0).checked = True Then
Selections = "Information systems"
Count = Count + 1
End If
If Form1.elements(1).checked = True Then
If Count <> 0 Then
Selections = Selections & ", "
End If
Selections = Selections & "Systems integrations"
Count = Count + 1
End If
If Form1.elements(2).checked = True Then
If Count <> 0 Then
Selections = Selections & ", "
End If
Selections = Selections & "System administration"
Count = Count + 1
End If
If Form1.elements(3).checked = True Then
If Count <> 0 Then
Selections = Selections & ", "
End If
Selections = Selections & "Management"
Count = Count + 1
End If
If Selections = "" Then
alert "You did not select any of the choices."
Else
alert "You checked the following choice(s): " & Selections
End If
End Sub
<-----------------------------------------------------> Tag: Grey font Tag: 151472
Error: "ActiveX component can't create object"
I use WSH and VBScript to run login scripts in our
network. They run fine on everyone's machine expect
one. On that one, I get the error,
ActiveX component can't create object: 'Scripting:
FileSystemObject'. Code 800A01AD
everytime there's a call in my code to
Set oFSO = CreateObject("Scripting.FileSystemObject")
I've reinstalled the most recent build of WSH 5.6 and
rebooted, but no difference. All the Google hits I find
are related to ASP programming (which I'm unfamiliar
with) and don't seem to be related to my issue.
Can anyone point me to what might be wrong/different with
this one machine that I can research and correct? Thanks. Tag: Grey font Tag: 151464
OBJECT tag web component embedding broken since windows update
All of the sudden my code which embeds an Office Web Component stopped
working and has only done so on computers that have applied the
critical Windows update
from the week of Jan 15, 2004.
Here is the snippet of code....
<object id=ChartSpace1
classid=CLSID:0002E500-0000-0000-C000-000000000046
style="width:100%;height:450"></object>
<script language=vbscript>
Sub Window_OnLoad()
Dim oChart
Dim oSeries1
dim oConst
'Ensure ChartSpace1 is empty:
ChartSpace1.Clear
Set oConst = ChartSpace1.Constants
'Create a new chart in the ChartSpace
Set oChart = ChartSpace1.Charts.Add
'Add a series of type Column
Set oSeries1 = oChart.SeriesCollection.Add
With oSeries1
.Caption = "My Percentage"
'.SetData oConst.chDimCategories, oConst.chDataLiteral,
Array(<%=chartaxes%>)
.SetData oConst.chDimValues, oConst.chDataLiteral,
Array(<%=chartvals%>)
.Type = oConst.chChartTypeSmoothLine
End With
Set mg = oChart.Axes(oConst.chAxisPositionLeft).MajorGridlines
mg.Line.Color = "white"
mg.Line.Weight = 1
Set axs = oChart.Axes (1)
axs.Font.Name = "Arial"
axs.Font.Size = "1"
'Add a second value axis to the Chart
'oChart.Axes.Add oChart.Scalings(oConst.chDimValues),
oConst.chAxisPositionRight, oConst.chValueAxis
'Display the legend
'oChart.HasLegend = True
'oChart.Legend.Position = oConst.chLegendPositionBottom
'Display the title for the chart
oChart.HasTitle = True
oChart.Title.Caption = "My Percentage"
End Sub
</script>
The VBScript error that IE is now displaying is:
"Error: Object doesn't support this property or method:
'ChartSpace1.Clear'"
It seems that it is not able to read to OBJECT tag or associate the id
with this object, so any/all properties/methods referencing this
embedded object are failing. I thought that this may be related to
Microsoft patent lawsuit with "eolas" but I cannot find a work around
(or even if this is infact the case). Anyone else experiencing
problems?
http://msdn.microsoft.com/ieupdate/activexchanges.asp
I'm on Win 2K with IE 6.0. Again - comps that didnt get the update
last week are not having the problem. Also, it is not my Internet
Zone security settings - I know that for sure. Tag: Grey font Tag: 151460
Script to check local reboot
There were 2 person who wrote this script and many thanks
to them. I tried this script and I am receiving an error.
call :checkReboot \\domain1.company.com
call :checkReboot \\domain2.company.com
call :checkReboot \\domain3.company.com
call :checkReboot \\domain4.company.com
call :checkReboot \\domain5.company.com
call :checkReboot \\domain6.company.com
goto :EOF
:checkReboot
set server=%1
for /f "tokens=7 delims= " %%q in ('uptime %server%') do
(set /a
numHours=%%q)
IF %numHours% GTR 1 (shutdown.exe server% /l /r /t:f /c /y)
The syntax of the command is incorrect.
'numHours' is not recognized as an internal or external
command,
operable program or batch file.
1 was unexpected at this time.
What is the correct syntax? Tag: Grey font Tag: 151453
possible to resize hta window?
Hello All,
I have been experimenting with hta files and would like to
know if anyone knows if it is possible to set the size of
the window of an hta file. If this is possible, may I
request how you do that? I have experimented a little bit
with window.location, but that only gave me filepathname.
While I'm at it, if it is possible (or not possible) to
resize the hta window is it possible to set the location
on the screen?
Thanks,
Rich Tag: Grey font Tag: 151448
Vbscript array used as parameter to a COM method
My code is a quite as following:
DIM TaskCardList(10)
....
TaskCardList(0) = "toto"
etc ....
AGTM.AddTask TaskCardList,10
The COM server expects an array of string. Unfortunately, the COM server is
not able to retrieve the item of the array.
What's wrong? ( we manage both client script and server).
A similar code works with VC++ and DElphi client.
Any help will be appreciated. Tag: Grey font Tag: 151442
Vbscript array used as parameter to a COM method
My code is a quite as following:
DIM TaskCardList(10)
....
TaskCardList(0) = "toto"
etc ....
AGTM.AddTask TaskCardList,10
The COM server expects an array of string. Unfortunately, the COM server is
not able to retrieve the item of the array.
What's wrong? ( we manage both client script and server).
A similar code works with VC++ and DElphi client.
Any help will be appreciated. Tag: Grey font Tag: 151441
Iterate Through Registry With VBScript
Can someone please give me an example of how to iterate through the registry
using vbscript? I have the following key that I need to iterate through.
HKEY_LOCAL_MACHINE\Software\Company Name\Site\
I need to get the key names and their values into an array. Can someone
send me a snippet of code that can do this?
Thanks,
Robbie Tag: Grey font Tag: 151437
pb download file with xmlhttp
hello
with my script i hava an error, dit you ave an idea ?
sSource = "http://go.microsoft.com/fwlink/?LinkId=18922"
sDest = "mssecure.txt"
set oHTTP = CreateObject("Microsoft.XMLHTTP")
set oStream = createobject("adodb.stream")
oStream.type = 1
oHTTP.open "GET", sSource, False
oHTTP.send
msgbox oHTTP.getResponseHeader
oStream.open
oStream.write oHTTP.responseBody
oStream.savetofile sDest Tag: Grey font Tag: 151406
reading values from a text file
Hi
I need to read some values from a text file stored in the server(later
on,these values will be assigned to a set of variables).
Is there a way to do such a thing using VBScript embedded in a ASP page?
Thanx in advance.
--
remove NOSPAM to send emails
ICQ #8860533 Tag: Grey font Tag: 151405
Returning Error Code
I want to run a VBScript through Windows Server 2000's scheduled task. On
failing to execute certain task within the script, I want the job to show up
as "Failed" with a result of 1 on the Scheduled Task list. How could this
be done?
"Return 1" does nott work. Even when 1 is returned, the "Last Result" still
show up as 0x0. Tag: Grey font Tag: 151401
Registry key enumeration
Hi,
I'm familiar with calling the Windows Scripting Host fom VBScript to
maniuplate the Registry, but can anyone please tell me if there is a way,
given a known Registry key, to enumerate the sub keys and/or values beneath
it?
Any assistance gratefully received.
Mark Rae Tag: Grey font Tag: 151399
Spool services takes a lot of CPU usage bafter AddWindowsPrinterConnection ?
Hi!
I have a login-script where 3 printers are mapped using
AddWindowsPrinterConnection - the problem is that the spool service on
WindowsXP hosts seems to take a lot of CPU-time after this action. The only
way to bring thing sback to normal is to restart the spooler service ...
Any idea why this happens ?
Regards,
/Brian Tag: Grey font Tag: 151396
INSERTing cyrillic characters in Access db via ASP ?
I am having trouble INSERTing cyrillic characters in an Access db via asp.
I can list cyrillic data fine.
I have
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
for the charset on the page but gibberish is inserted when adding data to
db. English can be inserted fine as well.
Anyone know a solution ?
thanks Tag: Grey font Tag: 151393
printing text
Please help or point me some other direction. Thanks!
I did not get an answer from a previous post. This is where it ended:
How do you get the object "printer" and where is the docs on what I can do
with printer (methods, events, properties, etc.) Someone told me "printer"
exists in vb but not vbs.
Thanks,
Paul Temple
"JR" <XXX.X@pandora.XXXX> wrote in message
news:qX%Gb.97754$sg7.4424744@phobos.telenet-ops.be...
> print to the printer
>
> Printer.print "you text"
>
>
> --
> Met vriendelijke groeten.
> Jan
> "Paul.Temple" <paul.temple@templesystems.net> schreef in bericht
> news:%23SkhXq8yDHA.3208@tk2msftngp13.phx.gbl...
> > 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: Grey font Tag: 151392
Edit windows host file
Not a VB programmer so I am hoping someone can help. I need a VB script that
will let me add and remove a FQDN into a windows "host" file when a user
logs on and off. When they log on I need the host file entry removed or
marked out when they log off I need it added back in .
It can even be a script that they will need to execute.
Can someone point me in the right direction.
Thanks
PB Tag: Grey font Tag: 151386
Forced download + IE6
I've tried a bunch of recommendations on forcing a download in IE6 rather than determine MIME type and open in browser, yet nothing works (even though it works fine in other browsers). Here's the code I've tried
Dim BlockOf, CountOf, objFile, objStrea
BlockOf = 10000
CountOf =
' Session is setup, and a file name (Request.Form("object") has been passed
If FSO.FileExists(Server.MapPath("download") & "\" & Session("username") & "\" & Request.Form("object")) The
Set objFile = FSO.GetFile(CStr(Server.MapPath("download") & "\" & Session("username") & "\" & Request.Form("object"))
' The filename you give it will be the one that is shown to the users by default when they save
Response.ContentType = "application/asp-unknown
Response.AddHeader "content-transfer-encoding", "binary
Response.AddHeader "content-disposition", "attachment; filename=" & objFile.Name & "
Response.AddHeader "content-length", objFile.Siz
Set objStream = Server.CreateObject("ADODB.Stream"
objStream.Ope
' Set as binary
objStream.Type =
Response.CharSet = "UTF-8
Response.Flus
' Load the file into the stream
objStream.LoadFromFile(CStr(Server.MapPath("download") & "\" & Session("username") & "\" & Request.Form("object"))
While objFile.Size > BlockOf + CountO
CountOf = CountOf + BlockO
Response.BinaryWrite objStream.Read(BlockOf
Response.Flus
Wen
Response.BinaryWrite objStream.Read(objFile.Size - CountOf
Response.Flus
Response.En
objStream.Clos
Set objStream = Nothin
Set objFile = Nothin
In particular, the AddHeader "Content-Disposition" line that is supposed to designate the initial filename does not work regardless of what I try. All it ends up displaying to the user is the parent folder hosting the site. Then when the download starts, the file cannot be found
As I said, if I try the code above in another browser it works fine in other browsers (both Mozilla/Firebird, and Opera) and according to the RFC, this should work
Any help would be appreciated. I've tried this on a number of different IE 6 installations, with 2000 and XP, and nothing makes any difference
fh. Tag: Grey font Tag: 151377
ODBC connection
Hello,
I have a ODBS defined for SQL server. How can I connect and retrieve data from a table in VBScript. Is there any examples.
Thanks.
Jim. Tag: Grey font Tag: 151373
how to pause code without using msgbox?
Hello all,
Many thanks to all who help me out here. Anway, I am
updating tables in an Access mdb from my app and then
copying files from a server to various workstations. What
happens is that the code will get to a FileCopy command
before various tables have finished updating where the
FileCopy command uses data from the tables. I have been
using msgbox "Pause" to stop code execution, but this is
not seamless. I believe my solution lies here:
Set Shl = CreateObject("WScript.Shell")
But what comes after Shl....?
Any suggestions how to pause code execution (without
msgbox) greatly appreciated.
Thanks in advance.
Rich Tag: Grey font Tag: 151359
Color sells in RDS control
Hello,
I have an old webpage that uses an RDS control. The declaration of the control looks like this:
<OBJECT classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33"
ID=dsoWM HEIGHT=1 WIDTH=1 VIEWASTEXT></OBJECT>
And down the page I data-bind a table
<table id=wmtable datasrc="#dsoWM"><tr><td><span datafld="Name"></span> </td><td><span datafld="City"></span> </td><td><span datafld="State"></span> </td><td><span datafld="MemberSince"></span> </td></tr></table>
My client now wants to color-code certain fields of the table. For example, all the records for people with MemberSince = 2003 should be colored light blue.
I am not sure how to achieve this without re-writing the page from scratch. Is it possible to tap into the rendering of the RDS control? Or, can I data-bind a color property???
Any ideas would be greatly appreciated.
Evgueni Tag: Grey font Tag: 151350
Get DOS errorlevel in WSH
Hello!
I've to get the errorlevel of a DOS program.
How can I call i.e. ROBOCOPY from Windows Scriptinh Host and get the
errorlevel of it.
THX to all can help
Werner Tag: Grey font Tag: 151349
Prob with adodb recordset object in vbs
Hello,
I need to read data to a vbs file from an Access Table. I
tried this:
Set cmd = CreateObject("ADODB.Command")
Set rs = CreateObject("ADODB.Recordset")
cmd.ActiveConnection = "Provider =
Microsoft.Jet.OLEDB.4.0; Persist Security Info=false;" _
& "Data Source=" & ScriptFolder & "test.mdb"
cmd.CommandText = "Select * from tbl1"
rs = cmd.Execute
Do while Not rs.EOF
Error says EOF not supported here. (or movenext, etc)
Then I tried a connection object:
conn.Open "Provider = Microsoft.Jet.OLEDB.4.0; Persist
Security Info=false;" _
& "Data Source=" & ScriptFolder & "test.mdb"
Set rs = conn.Execute("SELECT * from tbl1")
This did not do it either. Finally:
rs.Open "tbl1", conn, adOpenStatic, adLockPessimistic,
adCmdTable
Error says "Open" not supported. If I use a variant with
the connection object, that sort of works but not
consistently.
Set var = conn.Execute("Select * from tbl1").
Do While Not var.EOF
How can I get my Adodb recordset object to work in vbs?
Thanks in advance for any suggestions. Tag: Grey font Tag: 151340
VbScript Help
how do you declare a control in a outlook form so you could just Referance it later in the code. Right now i am placeing this in each functions
Set MyInspector = Item.GetInspector
Set MyPage = MyInspector.ModifiedFormPages("confreg")
set togddc02 = mypage.controls("togddc02")
just so i can use the togddc02 button click
Need some help with this
Thanks
Chris
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources... Tag: Grey font Tag: 151334
Reloading the environment variables
I need to reload user environment variables after a script is run...
The script adds user environment variables, and they appear to be there, but
not loaded into the system...
I have tried : "%windir%\System32\RUNDLL32.EXE
user32.dll,UpdatePerUserSystemParameters", _
1, True
But it doesn't seem to work...
Can anyone help me...
Or another way, is there a way to open up environment variables windows and
say OK to it within a script ( invisibly I guess )...
Because when this is done manually, it works very well..
Thanks !!!
--
--
Houman Yahyaei ( CCNA, MCSE Win 2000/NT 4.0, MCT )
IT Training and Consulting
www.formationhy.com
Houman@formationhy.com Tag: Grey font Tag: 151333
Help with Access and VBScript please
Hello,
I have created a WEB file with FrontPage and I find out how to get the
data from my database in Ms-ACCESS.
My question is if this is possible to execute a macro created in
ACCESS from the WEB site with VBScript?
Also, I would like to know if there is a way to execute my macro
automatically. For example, I want that one of my macro start by
itself each midnight.
Thank you for help.
Jiador Tag: Grey font Tag: 151332
Weird Type Mismatch Error
I'm stuck on this one - I can't figure out why it's giving me a type
mismatch error. I get the error on the line inside the "IF" statement
that assigns the value in the array to a variable: RegionNumber =
BranchCodes(x)
But if I remove that line, I'll get a type mismatch at the execution
of the SQL statement, and I *KNOW* the SQL is correct and works, as
I've tried that query directly on the DB.
Any suggestions?
/bw
--------------- CODE BELOW --------------------
DIM BranchCodes(10)
BranchCodes(0) = "R00"
BranchCodes(1) = "R01"
BranchCodes(2) = "R02"
BranchCodes(3) = "R03"
BranchCodes(4) = "R04"
BranchCodes(5) = "R05"
BranchCodes(6) = "R06"
BranchCodes(7) = "R07"
BranchCodes(8) = "R08"
BranchCodes(9) = "R09"
DIM objConn,objRS,strSQL,RegionNumber,x
'look up the region for this specific branch
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")
objConn.Open strDataConnect
for x = 1 to 9 'loop through once for each branch number
strSQL = "SELECT Region,RegionName,Location FROM BranchData WHERE
Region = '" & BranchCodes(x) & "'"
Set objRS = objConn.Execute(strSQL)
If NOT objRS.EOF Then
RegionNumber = BranchCodes(x)
Else
Response.Write("<P>Invalid Region Information</P>")
Response.End()
End If
Script continues.... Tag: Grey font Tag: 151329
There is a object order declaration ?!
I don't know what append to my PC, but from today I have this problem:
if I write a simple vbs script with this 2 line :
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set WSHShell = CreateObject("WScript.Shell")
I get a error on line 2: The specified procedure could not be found
If I invert the order:
Set WSHShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
I don't have problem !!!
Now all my old script could not be used anymore why I get the error I mention, but Why ?
The only think I remeber I done in tha last day was to install .Net Framework.
Thak's for any help Tag: Grey font Tag: 151323
Variables from one script to another
Hi...
I posted this before, but probably didn't explain my self well...
I need to have a script that declares and sets a value for some vb
variables, and want to have the value in these variables available in other
script...
Here is what I do :
I have a master script that calls other scripts...
1st script called from master script, it declares and sets values for some
variables ...
ex : Public appver1
appver1 = "V9_4_2"
2nd script called from master script would use the variables set in 1st
script to do execute actions with it...
ex : WshEnv("Var1") = appver1
How can this be done ...
The value is "appver1" is not necessary outside of the vb environment...
Reason is that 1st script will be modified by a lot of people, but don't
want them to modify other script...
Thanks very much !!!
--
--
Houman Yahyaei ( CCNA, MCSE Win 2000/NT 4.0, MCT )
IT Training and Consulting
www.formationhy.com
Houman@formationhy.com Tag: Grey font Tag: 151311
VBScript to Export Registry Key
Hello,
I am trying to build a script that exports a single registry key under
HKEY_LOCAL_MACHINE\SOFTWARE\Comapny Name\Product Name\Sites\ and all of the
subkeys. Can this be done. I have looked all over Google and can't find
anything on it.
Please let me know.
Thanks,
Robbie Tag: Grey font Tag: 151309
URL and/or complete command that calls a script.
Hey all,
I have a script that does something based on parameters entered when the
script is run. This works fine.
However, I need to call my script from within a 3rd-party app (Crystal
Reports). Due to limitations in this app, the script is called by a
hyperlink (as if it were from IE or so).
I cannot use spaces in the hyperlink, only thing that will really run the
script is
file:///mypath/myscript.vbs?param1=12345¶m2=54698
Anyone got a clue how to retrieve the params from this hyperlink?
IE is not shown in the process, the script just starts when clicking on a
hyperlink...
Thanx in advance.
(PS for the Crystal people: can't use UDF)
--
Clouds® Tag: Grey font Tag: 151304
VBScript error: Please Help
I am getting a Path Not Found error on a path that I know is correct.
Can anyone tell me what I might be doing wrong?
Here is what the code looks like:
Dim FSO, Infile, YR, path
path = "\\server\depts\GAL\GALLogs\"
YR=DatePart("YYYY", Date)
set FSO = createObject("Scripting.FileSystemObject")
set Infile = FSO.OpenTextFile(path & YR & "\YrToDate\Email.log", 1,
False)
I have tried different methods of building the actual path in the
OpenTextFile line and have had no success. Any help or suggestions
would be greatly appreciated. Thanks in advance.
Chuck Tag: Grey font Tag: 151302
Browse for Folder in Exchange
Hello,
I am not a programmer, so apologies if I am asking stupid questions...
I have created a customised form for use in exchange/outlook.
I have customised a page and added a webbrowser window. Using a (stolen)
script, I am able to display a folder list within this window by adding a
command button which asks the user to input a folder path.
I would like to add a command button that opens a 'browse for folder' dialog
box allowing the user to select the appropriate directory and display the
folder contents within the webbrowser window.
I have found a script (with several variations) on the web which apparently
does this, but this won't run in the script page due to various errors
(expected end of statement, syntax error etc.). As I don't know vbscript, I
can't troubleshoot the problems...
If anybody could help me out, it would be very much appreciated...
Thanks in advance,
Mike. Tag: Grey font Tag: 151297
IP dns question
I have a series of websites, let's call them "customer1.mydomain.co.uk" -->
"customer200.mydomain.co.uk".
Each URL is bound to an individual IP address which can be resolved using
nslookup.
So, for example
customer1.mydomain.co.uk = 100.200.300.1
customer200.mydomain.co.uk = 100.200.300.200
However, I can't fit all these 200 websites on the same server, so I have
bought 4 servers, serverA -> serverD.
I have arbitrarily put customer 1-50 on serverA, customer 51-100 on serverB
etc.
Having set all this up, I now find that customers 1-50 represent most of the
load, so I want to distribute the load a bit more evenly. You can imagine
the scenario.
As part of my Admin tools, I've created a display that does dynamic lookups
of the URLs and returns me the IP address from the DNS A record. However, I
want to have some way of finding out which machine this IP is actually bound
to. I'm constantly migrating dealers from one server to another and keeping
track of this manually is too great a headache. Does anyone know of a
method of saying "I've know the web site address by a) the URL and b) the IP
address, I now need to find out the name of the server on which it is
bound". Each server has a primary IP address that is "permanent" and not
associated with any customers' web site.
Any ideas?
Thanks
Griff Tag: Grey font Tag: 151296
error '80004005' with attachment
The following script, when sent without "myMail.AttachFile(fileToSend)" works perfectly. When I add the attachment, however, I get an "error '80004005' Unspecified error " with a reference to the line referring to the attachment. Does anyone have any idea why that might be?
Thanks
Code:
<%
DIM fileToSend
fileToSend = Request.Form("attachedfile")
Response.Write(fileToSend)
Set myMail = Server.CreateObject("CDONTS.Newmail")
myMail.From=Request.Form("senderID")
myMail.To=Request.Form("recipientID")
myMail.Subject=Request.Form("mailSubject")
myMail.Body=Request.Form("mailBody")
myMail.AttachFile(fileToSend)
myMail.Send
%>
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources... Tag: Grey font Tag: 151292
lastIndexOf in VBScript
Hello,
Can anyone tell me where I can find some info on how to use string.lastIndexOf("?") in VBScript.
I thought it was possible, but can't make it work.
All contributions greatly appreciated.
Thanks
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources... Tag: Grey font Tag: 151288
How to avoid the grey font in disabled select box?