Executing Applications on a Server Through an ASP Page
pardon me if this is a wrong group to post this question...!
I am trying to invoke a batch file on the server using a link/button on the
ASP web page.
I tried
Set WShShell = Server.CreateObject("WScript.Shell")
RetCode = WShShell.Run("C:\test1.bat")
-***-
Set Executor = Server.CreateObject("ASPExec.Execute")
Executor.Application = "cmd.exe"
Executor.Parameters = "/c c:\test1.bat"
Executor.ShowWindow = False
strResult = Executor.ExecuteWinApp
Neither of them work......
any ideas.....
thanks in advance,
_Uday Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184108
How do I remove 8 Characters from the Right of a variable?
How do I remove characters from the right of a populated variable, removing
@bla.com from a UPN for example? Assume variableA = first.last@bla.com
I've tried using things like - variableB = Right(variableA, 8), I know it
returns the last 8 as the variable I'm using - variableB =
StripRightNCharacters(variableA, 8), this one returned nothing so I may be
using it wrong.
I know the characters I want to remove, they are always on the right and
always the same number, and always the same characters, like @bla.com
Everything seems to be geared towards counting from the left and trimming,
but the number of characters on the left change in my example...
Is there a simple function I can call that I'm not seeing?
Thank you,
--
Sean M. Loftus
Enterprise Architect
Loftus Consulting, Inc.
www.LoftusConsulting.com
sean(removeme)@loftus.org Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184103
Error loging in VBscript
I have a script that is doing a few thing like running out to the web
and unzipping files is there any way to have the script create and send
all error to a log file. Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184102
Logging a script timeout
I have a login script that i have set to timeout if it runs for more than 30
secs using wscript.timeout. But now i would like to be able to write this
timeout event to the event log. Is this possible. Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184100
Enumerate administrators group with the aid of registry
Hi All,
How I can enumerate Administrators group on WinXP
with the aid of registry ?
Best Regards
Boris Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184094
OU printing
Below is a printer script I am running through a GPO on an OU, If the
computer and printer are in a top level OU then it works ok. Once the
computer goes into an OU that is one OU level deeper it doesnt work. Have
configured each OU the same as far as printers computers an policies. I just
move the printer and computer to the next OU and it doesnt work. It's like
the script isn't reading deep enough.
DOMAIN.COM
OU 1 (works)
OU 2 (No working)
OU 3 (works)
OU 4 (No working)
Can anyone help?
__________________________________________________________________________________________________________________________
Option Explicit
Dim objWshNetwork '<Windows Script Host Network Object>
Dim strComputerName '<CN= + Computer name string>
Dim strDomain '<Domain Name string>
Dim strLDAPDomain '<String to query the LDAP server>
Dim arrayDomain '<Temp Array>
Dim intCount '<Temp Counter>
Dim objOUPrintQues '<Object to hold the list of Printers>
Dim objPrinter '<Printer Object>
Dim objOUComputers '<List of computer objects>
Dim objComputer '<Computer object>
Dim strComputerOU '<String of the OU the computer is in>
Dim objOUList '<List of OU objects>
Dim objOU '<OU Object>
Dim boolFound '<Flag that the computer is found>
'********************* Very important, change only this
*********************************************************
strDomain = "home.com" '<Enter the Domain name, KEEP THE QUOTES>
' Notes:
' Use the DNS name! ie domain.com
'
'*****************************************************************************************************************
Set objWshNetwork = WScript.CreateObject("WScript.Network") '<Make a new
network object>
strComputerName = "CN=" & objWshNetwork.ComputerName '<Get the current
computer name and add "CN=" to the begining
'strComputerName = "CN=JaysPC" '<Debugger>
strLDAPDomain = "LDAP://"&strDomain '<Set the LDAP string to get all
the AD OU Objects
On Error Resume Next '<Turn on Error Handling>
Set objOUList = GetObject(strLDAPDomain) '<Get all the AD OU Objects>
If err <> 0 Then '<Catch the error, exit if error>
WScript.Echo "Error: " & err.number & " The Domain: "&strLDAPDomain& " was
not found. Check the logon script or network connection. REF:AD Objects"
Set objWshNetwork = Nothing
Set objOUList = Nothing
WScript.Quit
End If
On Error Goto 0
'<---------------------------------------- FIND WHAT OU THE COMPUTER IS
N --------------------------------------------------------------------->
For Each objOU In objOUList '<Step through each OU in domain>
strLDAPDomain = "LDAP://"&strDomain&"/" &objOU.Name '<Add the OU to the
end of the LDAP string>
arrayDomain = split(strDomain,".") '<Break up the domain name into
parts>
For intCount = 0 to ubound(arrayDomain)
strLDAPDomain = strLDAPDomain & ", DC=" & arrayDomain(intCount) '<Add
the search base>
next
On Error Resume Next '<Turn on error handling>
Set objOUComputers = GetObject(strLDAPDomain) '<Get all the objects in
the current OU>
If err <> 0 Then '<Catch the error, exit if error>
WScript.Echo "Error: " & err.number & " The Domain: "&strLDAPDomain& " was
not found. Check the logon script or network connection. REF:OU Objects"
Set objWshNetwork = Nothing
Set objOUList = Nothing
Set objOU = Nothing
Set objOUComputers = Nothing
Set arrayDomain = Nothing
WScript.Quit
End If
On Error Goto 0
objOUComputers.Filter = Array("Computer") '<Filter the objects, only
care about computers>
For Each objComputer In objouComputers '<Step through each computer
in the OU>
If objComputer.Name = strComputerName then '<If the current computer
is in this OU...>
boolFound = TRUE '<Set found to TRUE>
Exit For '<Stop searching this OU>
end if
Next
If (boolFound) Then
Exit For '<Found the computer in this OU, stop searching the OUs>
End If
Next
'<------------------------------------------------------------------------------------------------------------------------------------------------------->
On Error Resume Next '<Turn on error handling>
Set objOUPrintQues = GetObject(strLDAPDomain) '<Get all the objects in
the current OU>
If err <> 0 Then '<Catch the error, exit if error>
WScript.Echo "Error: " & err.number & " The Domain: "&strLDAPDomain& " was
not found. Check the logon script or network connection. REF:Printer
Objects"
Set objWshNetwork = Nothing
Set objOUList = Nothing
Set objOU = Nothing
Set objOUComputers = Nothing
Set arrayDomain = Nothing
Set objComputer = Nothing
Set objOUPrintQues = Nothing
WScript.Quit
End If
On Error Goto 0
objOUPrintQues.Filter = Array("PrintQueue") '<Filter the objects, only
care about printers>
For Each objPrinter In objouPrintQues '<Step through each printer in
OU>
If Trim(LCase(objComputer.Description)) =
Trim(LCase(objPrinter.Description)) Then '<If the printer and computer
description are same>
'<----Descriptions are the same, install the printer AS
DEFAULT ----------------------------------------------->
'WScript.Echo "Adding the printer: " & objPrinter.strPrinterPath & " - as
Default" '<debugger>
SetUpPrinter objPrinter.PrinterPath, TRUE '<Install the Default
Printer>
'<------------------------------------------------------------------------------------------------------------->
Else
'<----Descriptions are different, install the printer
anyway -------------------------------------------------->
'WScript.Echo "Adding the printer: " & objPrinter.strPrinterPath & " - NOT
as Default" '<debugger>
SetUpPrinter objPrinter.PrinterPath, FALSE '<Install the Printer>
'<------------------------------------------------------------------------------------------------------------->
End If
Next
'<-- Clean up memory -->
Set objWshNetwork = Nothing
Set arrayDomain = Nothing
Set objOUPrintQues = Nothing
Set objPrinter = Nothing
Set objOUComputers = Nothing
Set objComputer = Nothing
Set objOUList = Nothing
Set objOU = Nothing
WScript.Quit
'<End of Main Program>
'<---------------------------------------------------------------------------------------------------------------------------------------------------->
Function SetUpPrinter(strPath,boolSetToDefault)
On Error Resume Next '<Turn on error handling>
objWshNetwork.AddWindowsPrinterConnection strPath '<Add the printer>
If err <> 0 Then '<Catch the error, return if error>
WScript.Echo "Error: " & err.number & " The Printer: "& strPath & " was
not found. Logoff and Login again or check the logon script or network
connection. If this persists, restart your server."
Exit Function
End If
On Error Goto 0 '<Turn off error handling>
If (boolSetToDefault) Then
objWshNetwork.SetDefaultPrinter strPath '<Set the printer to default>
End If
End Function
_________________________________________________________________________________________________________________________ Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184093
Newbie Needing Help
Hi there Group,
Hope somebody wouldn`t mind helping me out here?
I`ve Created the following VB Script:
Set objShell = CreateObject("WScript.Shell")
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
dDate = Now
sDateTime = Year(dDate) & Right(100 + Month(dDate),2) _
& Right(100 + Day(dDate),2) & "_" & Right(100 + Hour(dDate),2) _
& Right(100 + Minute(dDate),2) & Right(100 + Second(dDate),2)
sFilename = sDateTime & ".zip"
'WScript.Echo sFilename
'Set a Backup job to PKZip
objShell.Run "C:\pkware\pkzip25\pkzip25 -add -path=relative
C:\zips\DataBackups\HFSdata" & sFilename _
& " c:\hfsdata\*.*"
objShell.Run "C:\pkware\pkzip25\pkzip25 -add -path=relative
C:\zips\DataBackups\BomTrans" & sFilename _
& " c:\bomtrans\*.*"
objShell.Run "C:\pkware\pkzip25\pkzip25 -add -path=relative
C:\zips\DataBackups\MyDocuments" & sFilename _
& " c:\Documents and Settings\%USERNAME%\My Documents\*.*"
'Delete OLD Data - This Keeps 7 Days worth of Backups
Set Folder = FSO.GetFolder("C:\zips\DataBackups\HFSdata")
For Each File in Folder.Files
If DateDiff("d", CDate(File.DateLastModified), Now()) > 7 Then
FSO.DeleteFile File
Next
Set Folder = Nothing
Set FSO = Nothing
Set Folder = FSO.GetFolder("C:\zips\DataBackups\BomTrans")
For Each File in Folder.Files
If DateDiff("d", CDate(File.DateLastModified), Now()) > 7 Then
FSO.DeleteFile File
Next
Set Folder = Nothing
Set FSO = Nothing
Set Folder = FSO.GetFolder("C:\zips\DataBackups\MyDocuments")
For Each File in Folder.Files
If DateDiff("d", CDate(File.DateLastModified), Now()) > 7 Then
FSO.DeleteFile File
Next
Set Folder = Nothing
Set FSO = Nothing
What I would like to do is at the end of the running, send e-mail to the
User to Tel Them the Filenames of the 3 Files Created, and Weather of Not
the backup was sucessfull of wether it failed. How would I go about this?
Like i said Im a newbie so would be greatfull if somebody could explain
simply for me?
Many Thanks
NSC Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184092
Table querying in ASP
This is a simple question, so sorry for my newbieness. How do I query
data about a html table? Specifically I want to know how many columns
there are currently. I thought something like this would have worked:
<% NumCols = Request("Columns") %>
But it doesn't. Any help greatly appreciated. Thanks.... Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184090
QUERY: auto clean VB editor
Is there any way to auto clean indent the VB code? If not, anyone know an
additional 3rd party program to do so? Such cleaning eg. removing trailing
whitespace, formating/correct indentation, etc. Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184089
deleting users in AD
Hi
I've written a script to delete some users from Windows 2000 Active
Directory, I would also like to remove their home folders and Exchange
mailboxes.
I'm using the code below:
--------------------------------------------------------------------------------------------------------------------
dim fso
set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.OpenTextFile("C:\temp\DelUser.txt")
Do While not f1.atEndOfStream
strUser = f1.readline
Set objItem = GetObject("LDAP://CN=" & strUser &_
",ou=Management,dc=NA,dc=fabrikam,dc=com")
strprofilePath = objItem.Get("profilePath")
' WScript.Echo "profilePath: " & strprofilePath
strhomeDirectory = objItem.Get("homeDirectory")
' WScript.Echo "homeDirectory: " & strhomeDirectory
fso.deletefolder strhomeDirectory, True
Set objOU =
GetObject("LDAP://ou=Management,dc=NA,dc=fabrikam,DC=com")
objOU.Delete "User", "CN=" & StrUser
Loop
----------------------------------------------------------------------------------------------------------------------------
The code to delete the users works fine (their names are all in a text
file which the script reads). I can also read the users home folder
but I cannot work out a way to delete the folder once it is read. I'm
also unsure as to how to go out about removing the users Exchange
mailboxes as I am deleting them.
Any help greatly appreciated.
Tony Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184088
Read csv text file and write new file without header or eof char
All,
Can anyone tell me hoe or provide a sample vb script that will read a
csv text file and write it to a new file without the header and the
end of file character ?
TIA!
cmoorhead@mindspring.com Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184080
pc performance troubleshooting
Anyone have a nice script that will report some common config issues /
problems that might affect pc performance? I am thinking vbs version of
PCPitstop or some similar tool. Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184076
File extension and ftp problem
I'm sorry for my bad english but I'm Italian...
How I can write a vbs script for search file with "xml" extension and copy
them on a remote machine...
Thank's Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184075
Cross site / cross domain question
Hi folks,
I need your help!
I need to set values of a form from a page inside a frameset at other domain.
OR
Take the value of a hidden field value in a form from a page inside a
frameset at other domain.
Thanks in advance. Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184073
Replace text within file based on file name
Hello:
I am working on a script that takes a .txt log file and puts it in a
database. I have everything working on this script with the exception of one
small item: Date Conversion (which I am manually doing at this time).
I need to replace the format of the date (YYYY-MM-DD) in the text file to be
the same format as the filename.
Filename:
11-27-2005-PingLogs.txt
Sample text:
2005-11-27 00:00:47,192.168.2.1,Ping: No Response
2005-11-27 00:00:47,192.168.2.1,Ping: No Response
2005-11-27 00:00:47,192.168.2.1,Ping: No Response
2005-11-27 00:00:47,192.168.2.1,Ping: No Response
2005-11-27 00:00:47,192.168.2.1,Ping: No Response
Converted date:
11-27-2005,00:00:47,192.168.2.1,Ping: No Response
11-27-2005,00:00:47,192.168.2.1,Ping: No Response
11-27-2005,00:00:47,192.168.2.1,Ping: No Response
11-27-2005,00:00:47,192.168.2.1,Ping: No Response
11-27-2005,00:00:47,192.168.2.1,Ping: No Response
How can I find each occurrence of the YYYY-MM-DD format and replace it with
the same format in the filename?
P.S. I cannot get the date to export any other way to the log file.
Thanks
CADstillo Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184071
newbie: errorhandling on wshshell.regread
dear vbs gurus
the following code reports an error -> invalid root in registrykey, if the
registry key is not existent. why does my error handling not return ->
Function False instead of the error box displayed. thanx alot
tim
snip.........................
If CheckRegKey(strMapNameKey)= True then
MsgBox " Function True "
Else
MsgBox " Function False "
End If
Function CheckRegKey(RegStr)
On Error Resume Next
WshShell.RegRead RegStr
If Err Then
CheckRegKey = False
Else
CheckRegKey = True
End If
On Error Goto 0
End Function Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184060
Please critique this HTA (Change Database Remotely)
Hello. As a novice in both VBScript and HTML, I usually find code
snippets, tweak 'em to my specifications, then bolt 'em all together to
accomplish what I need. Like in this case. The following script works
fine, but I'm sure it can be streamlined, corrected, and the redundancy
removed.
This HTA will be used to "change the database" of a remote server,
which involves 3 major tasks:
A. Make specific changes to the Registry (using .REG files)
B. Copy a specific Configuration.xml file
C. Restart IIS
The high level functions of the HTA are as follows:
1. Enter or select a server (opens that server's version.ini file once
selected)
2. Select a "release" (determines the source PATH for the
Configuration.xml and .REG files)
3. Select a "database" (determines the source Configuration.xml and
.REG files to be copied)
4. If the target Configuration.xml and .REG files exist and are Read
Only, remove the Read Only attribute
5. Enable the "Change Database" button only when the server, release
and database have been selected.
6. After the "Change Database" button is clicked and the script is
executed:
- reset all variables
- reset text and list boxes
- disable the "Change Database" button
Some obvious things that I imagine can be addressed:
- The conditional IF statement used to enable the "Change Database"
button...I've had to put it in multiple subroutines. Is there a better
way?
- I'm using the sysinternals.com utility PSEXEC to remotely change the
Registry. Is there a better way?
- I'm using the sysinternals.com utility PSEXEC to remotely restart
IIS. Is there a better way?
- I'm using repeated entries of the HTML " " to insert a large
number of spaces in between text and listboxes. Is there a better way?
Any suggestions would be greatly appreciated. Thanks!
- Dave
Watch for word wrap:
===== BEGIN Change_Database_Remotely.hta ====================
<html>
<head>
<title>Change Database Remotely</title>
<HTA:APPLICATION
ID="HTAUI"
APPLICATIONNAME="HTA User Interface"
SCROLL="no"
SINGLEINSTANCE="yes"
WINDOWSTATE="maximized"
>
</head>
<style>
BODY
{
background-color: buttonface;
font-family: Helvetica;
font-size: 12pt;
margin-top: 2px;
margin-left: 8px;
margin-right: 3px;
margin-bottom: 3px;
}
</style>
<SCRIPT language="VBScript">
Dim strServer
Dim strVersionFile
Dim strRelease
Dim strReleasePath
Dim strDatabase
Dim strNewREGFile
Dim strREGPath
Dim s
Dim r
Dim fso
Dim f
Dim sFILE
Dim objShell
Dim objWshScriptExec
Dim objStdOut
Dim objFSO
Dim strREGFileSourcePATH
Dim strREGFile
Dim strTargetPATH
Dim strEXEFile
Dim strConfigPath
Dim strNewConfigFile
Dim strConfigFileSourcePATH
Dim strTargetConfigFile
Dim strREGImportCMD
Dim strIISResetCMD
Sub Window_Onload
self.Focus()
self.ResizeTo 600,500
self.MoveTo 200,50
' Clear all variables in order for the
' "Enable Change Database button" IF statement to work
strServer = ""
strRelease = ""
strDatabase = ""
End sub
Sub ServerButton
strServer = txtServerInput.Value
strCMD = "notepad"
Set objShell = CreateObject("WScript.Shell")
If strServer = "" Then
strServer = cboServerSelection.Value
strVersionFile = "\\" & strServer & "\D$\Program Files\Adss\Patch
Level\Version.ini"
Set objWshScriptExec = objShell.Exec (strCMD & " " & strVersionFile)
Else
strVersionFile = "\\" & strServer & "\D$\Program Files\Adss\Patch
Level\Version.ini"
Set objWshScriptExec = objShell.Exec (strCMD & " " & strVersionFile)
End If
' Enable Change Database button when all criteria is selected
If strServer <> "" and strRelease <> "" and strDatabase <> "" Then
ChangeDatabase_button.Disabled = False
spServer.InnerHTML = strServer
End Sub
Sub ReleaseSelectList
strRelease = ReleaseSelection.Value
If strRelease = "July" Then
strReleasePath = "July 2005 Release\"
Else
strReleasePath = ""
End If
' Enable Change Database button when all criteria is selected
If strServer <> "" and strRelease <> "" and strDatabase <> "" Then
ChangeDatabase_button.Disabled = False
spRelease.InnerHTML = strRelease
End Sub
Sub DBSelectList
strDatabase = DBSelection.Value
strNewREGFile = strDatabase & ".REG"
' Enable Change Database button when all criteria is selected
If strServer <> "" and strRelease <> "" and strDatabase <> "" Then
ChangeDatabase_button.Disabled = False
spDatabase.InnerHTML = strDatabase
End Sub
Sub ChangeDatabase
' Copy REG.EXE and Database REG file to target server temp folder
strREGPath = "\\ServerName\D$\ASISS Team\Tools\Reg Keys\"
strREGFileSourcePATH = strREGPath & strReleasePath & strNewREGFile
strTargetPATH = "\\" & strServer & "\C$\TEMP\"
strEXEFile = "\\ServerName\D$\ASISS Team\Tools\Batch\Reg.exe"
' Modify the Read Only attribute if necessary
If CreateObject("Scripting.FileSystemObject").FileExists(strTargetPATH
& strNewREGFile) Then
' Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(strTargetPATH & strNewREGFile)
' If the first bit of the attributes byte is set to 1,
' the file is Read Only.
' If this is the case, clear the first bit.
If f.attributes and 1 Then
f.attributes = f.attributes - 1
End If
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile strREGFileSourcePATH, strTargetPATH, True
objFSO.CopyFile strEXEFile, strTargetPATH, True
Set fso = Nothing
Set f = Nothing
Else
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile strREGFileSourcePATH, strTargetPATH, True
objFSO.CopyFile strEXEFile, strTargetPATH, True
End If
' Copy Database CONFIG file to target server Webview folder
strConfigPath = "\\ServerName\D$\ASISS Team\Tools\XML Config Files\"
' Check to see if "TEST" is in the file name
s = "TEST"
r = InStr(strDatabase, s)
If r = 1 Then
strConfigDatabase = right(strDatabase,2)
strNewConfigFile = "Configuration-" & strConfigDatabase & ".xml"
Else
strConfigDatabase = strDatabase
strNewConfigFile = "Configuration-" & strConfigDatabase & ".xml"
End If
strConfigFileSourcePATH = strConfigPath & strReleasePath &
strNewConfigFile
strTargetConfigFile = "\\" & strServer &
"\D$\Inetpub\wwwroot\WebView\Configuration.xml"
' Modify the Read Only attribute if necessary
' Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(strTargetConfigFile)
' If the first bit of the attributes byte is set to 1,
' the file is Read Only.
' If this is the case, clear the first bit.
If f.attributes and 1 Then
f.attributes = f.attributes - 1
End If
Set fso = Nothing
Set f = Nothing
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile strConfigFileSourcePATH, strTargetConfigFile, True
' Change Registry
strREGImportCMD = "Psexec" & " \\" & strServer & " " & "cmd /c
C:\TEMP\REG IMPORT"
Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec(strREGImportCMD & " " &
strNewREGFile)
' Restart IIS
strIISResetCMD = "Psexec" & " \\" & strServer & " " & "cmd /c
C:\WINNT\system32\IISRESET /RESTART"
Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec(strIISResetCMD)
Set objStdOut = objWshScriptExec.StdOut
' Display the output of strIISResetCMD
strOutput = objStdOut.ReadAll
MsgBox strOutput, vbInformation, "Change Database Remotely -
COMPLETED."
' Disable Change Database Button
ChangeDatabase_button.Disabled=True
' Clear variables
strServer = ""
strRelease = ""
strDatabase = ""
' Reset all text and list boxes
txtServerInput.value = ""
cboServerSelection.value = ""
DBSelection.value = ""
ReleaseSelection.value = ""
End Sub
' Cleanup
Set strServer = Nothing
Set strVersionFile = Nothing
Set strRelease = Nothing
Set strReleasePath = Nothing
Set strDatabase = Nothing
Set strNewREGFile = Nothing
Set strREGPath = Nothing
Set s = Nothing
Set r = Nothing
Set fso = Nothing
Set f = Nothing
Set sFILE = Nothing
Set objShell = Nothing
Set objWshScriptExec = Nothing
Set objStdOut = Nothing
Set objFSO = Nothing
Set strREGFileSourcePATH = Nothing
Set strREGFile = Nothing
Set strTargetPATH = Nothing
Set strEXEFile = Nothing
Set strConfigPath = Nothing
Set strNewConfigFile = Nothing
Set strConfigFileSourcePATH = Nothing
Set strTargetConfigFile = Nothing
Set strREGImportCMD = Nothing
Set strIISResetCMD = Nothing
</SCRIPT>
<BODY>
<H2 align="center">Change Database Remotely</H2>
<p align="left"><font face="serif" size="4"><b>Enter or select a server
(it's version.ini file
will open):</b></font><br/>
<align="left">
<input type="text" id="txtServerInput"/><br/>
<align="right">
<select id="cboServerSelection">
<option value="0"></option>
<option value="Server1">Server1</option>
<option value="Server2">Server2</option>
<option value="Server3">Server3</option>
<option value="Server4">Server4</option>
<option value="Server5">Server5</option>
<option value="Server6">Server6</option>
</select><br/>
<button onclick="ServerButton">Submit</button>
<p align="left"><font face="serif" size="4"><b>Select a
release: Select
a database:</b></font><br/>
<align="left">
<select id="ReleaseSelection" onChange="ReleaseSelectList">
<option value="0"></option>
<option value="July">July</option>
<option value="December">December</option>
</select> <select
id="DBSelection" onChange="DBSelectList">
<option value="0"></option>
<option value="TESTAJ">TESTAJ</option>
<option value="TESTAP">TESTAP</option>
<option value="TESTAT">TESTAT</option>
<option value="TESTZB">TESTZB</option>
<option value="TESTZE">TESTZE</option>
<option value="TESTZF">TESTZF</option>
<option value="TESTZG">TESTZG</option>
<option value="TESTZH">TESTZH</option>
<option value="TESTZJ">TESTZJ</option>
<option value="TESTZL">TESTZL</option>
<option value="TESTZS">TESTZS</option>
<option value="TESTZT">TESTZT</option>
<option value="TESTZU">TESTZU</option>
<option value="FPT">FPT</option>
<option value="PIONEER">PIONEER</option>
<option value="Production_Training">Production_Training</option>
<option value="PRODUCTION">PRODUCTION</option>
</select><br/>
<p>
<hr>
<span id =spServer></span>
<p>
<span id =spRelease></span>
<p>
<span id =spDatabase></span>
<hr>
<p align="left">
<input id=ChangeDatabaseButton class="button" type="button"
value="Change Database"
name="ChangeDatabase_button" onClick="ChangeDatabase" Disabled=True>
</BODY>
</html>
===== END Change_Database_Remotely.hta ==================== Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184057
Img Src=asp page
Hi,
My site (site A) is a referral site that sends leads to advertisers (site B)
on our site.
When the user clicks on one of the advertisers, we drop a cookie on their
machine. The cookie has an expiration date of 30 days.
When the user buys a product and the receipt page is loaded, there is an
image tag pointing to an asp page on Site A.
For instance (<img src="
http://www.siteA.com/roitracker/roitracker.asp?ID=123&price=456&orderNo=789"
width=1 height=1>)
As you can see, we pass 3 parameters. We upload those parameters to our
database.
This code works in Firefox. It only works in IE if we allow permissions for
3rd party cookies. Any ideas how to solve this issue and get around the
security for IE? is there another way that we can fix this issue?
Please advise.
Thanks Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184056
Sounding audible alert in script.
I would like to sound a periodic "ding" in a long running script, something that
would sound without halting script progress. All I have been able to do is
insert a message box, but that stops the script until the box is dismissed by
the user. Is there any way to sound an alert without stopping for a user
response?
--
Crash Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184055
Excel 2003 filesystem dialog box...
Is there a way to open an explorer type dialog box to help a user
select a folder to save a document in?
For instance, the user clicks on a submit button in a worksheet and a
explorer like dialog opens where the user and browse to the desired
folder and the click okay to pass that folder path back to the VBA
script.
Thanks
Kevin Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184053
Script request
I am looking for a script that will scan a set of computers (based on an
ActiveDirectory OU), and generate a list of all services, and their running
account... (Not really required if the account is LOCAL SYSTEM). Also, a
script that will scan all workstations/servers and generate a list of local
accounts. I believe I have seen a RESKIT TOOL, that will generate a list of
local account but must be on a machine by machine basis. Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184051
Create ODBC source - how to ?
Hi,
Do I have a way to call SQLConfigDataSource and SQLInstallerError from
VBScript ?
Or may be there is other way to achieve equivalent functionality ?
Thank you in advance for your replies. Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184050
Network Neighbourhood enumeration - how to ?
Hi,
Of course it is possible to spawn 'net view' and look through its
printout,
But I would like to do this in proper Shell/COM way.
I.e. starting from 'Entire Network', getting network types,
then workgroups inside them, then computers inside workgroups.
Please give me a direction on where to dig
Thank you in advance. Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184047
Sending an email message
Hi,
I'm not very familiar with using vbScript and MS Office products. Can
someone point me in the right direction regarding an error I am receiving
when trying to send an email? The error I am getting is "The 'SendUsing'
configuration value is invalid."
My code looks like this:
Set oMyMail = CreateObject("CDO.Message")
oMyMail.To = "user@test.com"
oMyMail.Subject = "Test Mail from script"
oMyMail.Textbody = "Please ignore"
oMyMail.AddAttachment "C:\output.txt"
oMyMail.MIMEFormatted = False
oMyMail.Send
WScript.Echo "Message Sent From : " & oMyMail.From
WScript.Echo " to : " & oMyMail.To
I don't know if this is significant, but I'm using an Exchange 5.5 server, I
have Outlook 2002 running as my client, and I am logged in as a
non-Administrator.
Thanks in Advance,
JeffH Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184041
Script to reboot PCs
Hi all,
I was wondering if you can show me the code necessary reboot a Windows 2K or
Windows XP equipmented PC? I frequently remote into a number of PCs and
sometimes the need a reboot. Instead of asking someone directly and asking
them to reboot the machines, isn't there a way to write a VBS script to do
that?
Can you also share with me the JScript equivalent for the WSH environment?
Many thanks.
Ben
-- Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184033
Just-In-Time Debugger Shows Runtime Error in Startup Dialogue Box
I'm just completing a working VBScript to use Telnet to send an e-mail
when an error is detected by a scheduled task (for my sample I'm using
not enough space on the C drive). I'm aware that there are also other
solutions such as BLAT but I don't want to install any code.
Everything seems to work well and I get the e-mail in my account but I
have this nagging concern.
The dialogue box labelled "Just-In-Time Debugger" has at the top the
message "An exception 'Runtime Error' has occurred in Script.". It
then lists Possible Debuggers of "New instance of Microsoft Script
Debugger" and "New Instance of Microsoft Script Editor". If I step
through there aren't any apparent problems. Do I really have a
problem? Thoughts??? Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184032
WSH Hotkey
When setting the WSH .Hotkey property how is the hotkey value set to the
default "None"? Whatever I use becomes the hotkey since the value assigned
to this property must be a string.
Dim oShell As New IWshShell_Class
Dim oShortCut As New IWshShortcut_Class
oShortCut.Hotkey = ??? 'Default..."None"
oShortCut.Save
Set oShell = Nothing
Set oShortCut = Nothing
I cant simply not refer to the hotkey property because it is overwriting an
already existing shortcut that has a hotkey in place but needs to be
overwritten. Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184031
let user change permission on his home-folder
dear vbs-ng, i could not find any help in the wsh-ng; may be you have an
idea:
the following script runs as a logon-script for a w2k3 domain for every
user. it creates a home-folder and should set the permission for the
administrator and the user. the permissions for the administrator are
correct, but the user who started the script during login, does not have any
rights. how can i give the user full right for its own home folder in a
script ?
thanx alot
tim
Dim WshNetwork, LogonUser
Set WshNetwork = WScript.CreateObject("WScript.Network")
Const WAIT_ON_RETURN = True
Const HIDE_WINDOW = 0
Const USER_ROOT_UNC = "\\server01\home$"
Const USER_ROOT_LOCAL = "D:\home"
LogonUser = WshNetwork.UserName
Call CreateHomeFolder(LogonUser)
Sub CreateHomeFolder(strUser)
Dim WshShell, objFS
Set WshShell = Wscript.CreateObject("Wscript.Shell")
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set objFS = CreateObject("Scripting.FileSystemObject")
Call objFS.CreateFolder(USER_ROOT_UNC & "\" & strUser)
Call WshShell.Run("cacls " & USER_ROOT_UNC & "\" & strUser & _
" /e /g Administrators:F", HIDE_WINDOW, WAIT_ON_RETURN)
'--> setting the users permission
Call WshShell.Run("cacls " & USER_ROOT_UNC & "\" & strUser & _
" /e /g " & strUser & ":F", HIDE_WINDOW, WAIT_ON_RETURN)
End Sub Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184030
Getting clients active DFS server name?
Hi! :)
I need to check the connection speed between the client and the server
before I start a program installation.
My problem is that the installation files are on a DFS share.
What I need is a list of the possible servers for this DFS share and if
possible, the currentlly active one.
In windows(xp) it's just to right click the directory accessed through a dfs
to see a list of the servers (The active one's marked).
This must be possible to get this information through a script to... Please
help. :)
(I'm using Win32_PingStatus to get the speed of the connection. If anyone's
got better way, please tell me. :) )
Thanks a million! :-)
/Sofia Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184029
Window name
Hello,
How to obtain the window name using only the executable path?
Thanks,
--=20
"A maior gl=F3ria n=E3o =E9 ficar de p=E9, mas levantar-se cada vez que se =
cai."
Conf=FAcio
Vinicius Canto Xavier - MCP Windows 2000 Server & SQL Server
Ciencias da Computa=E7=E3o 2004 - ICMC/USP - Brasil Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184026
SENDKEYS to Login to Windows
Guys ~ has anyone used SendKeys to script a login to Windows.
So, we have a Windows PC sitting at a logon screen and with a ?ap
deploy tool? deliver a script to login as local admin.
Can it be done were a Sendkeys will actualy pull up the login screen?
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "^%{DELETE}"
Your thoughts please
-
vusio
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
----------------------------------------------------------------------- Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184019
Recursing Folders
I have a task where I need to find matching file names under two folders
including subfolders.
I have a working recursive routine, but it seems to just quit recursing
before completion.
Does anyone have any ideas?
Thanks a million for any help. Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184017
How do you pass arguments to a script
Back in DOS, you had batch files that could accept opening parameters.
How does one do that in VBS? Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184013
REGEXP
Hello,
I try to validate User Input via a Regexp.
Unfortunately it is not working...
The User types a chemical formular like: H2SO4
in order to handle this input properly via HTML the two numbers need to be
put between <sub></sub>.
And here where it all starts. Obviously these two tags have to occur in
pairs.
So I tried something like: ^\w*(<sub>\d*</sub>)*\w*
But that didn't work out.
Any ideas?
thx
Ralf Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184008
remove duplicate itunes songs
here's a little script to remove those annoying itunes duplicates.
just needs some modification such as your itunes directory...
-----------------
Set objFSO = Wscript.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("D:\iTunes")
Set colSubFolders = objFolder.Subfolders
'get inside each artist's folder
For Each objSubFolder in colSubFolders
'Wscript.Echo objSubFolder.Name
'once inside the folder do the following...
Set colSubSubFolders = objSubFolder.Subfolders
'Get inside each album folder
For Each objSubSubFolder in colSubSubFolders
'once inside do the following
'WScript.Echo vbtab & objSubSubFolder.name
Set colMP3Files = objSubSubFolder.Files
For Each objMP3File in colMP3Files
'Wscript.Echo vbtab & objMP3File.Name
strCurrentMP3Name = objMP3File.Name
For Each objMP3File2 in colMP3Files
'Wscript.Echo Left(strCurrentMP3Name, Len(strCurrentMP3Name)-4) &
vbtab & Left(objMP3File2.Name, Len(objMP3File2.Name)-6)
If UCase(Left(strCurrentMP3Name, Len(strCurrentMP3Name)-4)) =
UCase(Left(objMP3File2.Name, Len(objMP3File2.Name)-6)) Then
'Wscript.Echo(UCase(strCurrentMp3Name & vbtab & objMP3File2.Name))
Wscript.Echo objMP3File2.Path
objFSO.DeleteFile(objMP3File2.Path)
End If
Next
Next
Next
Next Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 184005
Problem runing EXE file with PARAMETERS
Hello All
I'm building a script to automatizing my work,
first i have to take all the files in a directory and rename there name
e.g - 000.jpg, 001.jpg, 002.jpg ...
but if the file is bigger then 59KB the script will call a program
(convert) to resize the file
so far the script do it's job to rename the files,
but when i call the exe file, nothing happen.
can any one help me here
function CreateNewFolder(byVal Path, byVal NewFolderName)
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim FullPath
FullPath = Path & NewFolderName
if Not objFSO.FolderExists(FullPath) Then
objFSO.CreateFolder(FullPath)
CreateNewFolder = True
Else
CreateNewFolder = False
End If
Set objFSO = nothing
End function
' ------------------------------------------
Dim objFSO
Dim objFolder
Dim FolderPath
Dim objFolder_Contain
Dim foundFile
Dim Crate_Folder_Named
Dim strFilename
Dim MaxFileSize
MaxFileSize = 59000
FolderPath = "f:\test\"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(FolderPath)
Set objFolder_Contain = objFolder.Files
Set oShell = CreateObject("WScript.Shell")
Crate_Folder_Named = "Renamed Files"
Call CreateNewFolder(FolderPath, Crate_Folder_Named)
Dim Prfix
Dim i
Dim Lenght
Lenght = 4
i=0
iRC = 0
For Each foundFile In objFolder_Contain
Prfix = ""
strFilename = foundFile.name
' ------------------------- Build The prefix for evry File
------------------------
For ii=1 to (Lenght-Len(i))
Prfix = Prfix & "0"
next
Prfix = Prfix & i
Extention = Right(strFilename,
len(strFilename)-InStr(strFilename, "."))
'------------------------------------------------------------------------
Dim fso, f1
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.GetFile(foundFile)
If (f1.Size > MaxFileSize) Then
iRC = oShell.Run("convert -resize 90% " & f1 & " " & FolderPath &
"test.jpg", 0, True)
'iRC = oShell.Run("ping 127.0.0.1 -t", 1, True)
If iRC <> 0 Then
WScript.Echo "convert returned error level " & iRC
Else
WScript.Echo "Convert finished"
End If
End If
f1.Copy(FolderPath & "\" & Crate_Folder_Named & "\" & Prfix &
"." & Extention)
i = i+1
Next
Set objFSO = Nothing
'---------------------
Msgbox "DONE" Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 183998
Question from newbie
Hi all,
I'm very new to VBScript. In fact, I've just learned VBScript today. My
question is that whether or not I can call the Win32 API function
GetSystemMetrics from VBScript ? In fact, I want to detect whether the
machine is running Tablet PC OS.
Thanks a lot. Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 183994
Displaying the format floppy disk window
Hi all,
Does anyone know the VBScript that will display the format a floppy disk
window/dialog.
Thanks very much for your help
Karen Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 183985
How to clear Published Certificates in AD for all users using VB
Hello All,
We need to clear all our published certificates from AD. I was able
to figure out how to do this per users/CN (script below) and I'm
wondering if it is possible to do this at the OU level?
Any help would be greatly appreciated. Thanks in advance!
AJZ
Const ADS_PROPERTY_CLEAR = 1
Set objUser = GetObject _
("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com")
objUser.PutEx ADS_PROPERTY_CLEAR, "userCertificate", 0
objUser.SetInfo
--
AJZ
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------ Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 183984
Changing local admin passwords via vb script
I found this script to change local computer account passwords.
Set objUser = GetObject("WinNT://" & strComputer & "/Administrator,user")
objUser.SetPassword("password")
I am new to scripting and I am unsure if it is safe to run this script on
the network. Does anyone have any experience changing passwords with
scripts. Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 183983
Writing into HKCU\...\Policies
Hi,
Since there is no way I can use script to modify GPO on a client PC (the PC
is not in the domain), I am trying to modify appropriate Registry key that is
responsible for the policy I need:
HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate\DisableWindowsUpdateAccess"=dword:00000001
The problem is that a user does not local Administrator rights, so I cannot
write that key/value. I could run VB script under local admin account, but
then HKCU would become admins HKCU, and I need to modify HKCU for the user,
not for the admin.
I tried to play with HKEY_USERS tree and got some results on XP: I was able
to find user's HKCU there and modify it, but on Windows 2000 SP4 the script
fails. When I am enumerating subkeys in HKEY_USERS using StdRegProv function
EnumKey (and the script is being run in the local admins context) it does not
return list of subkeys representing user profiles. Instead, it retuns subkeys
for .DEFAULT profie. Anyways, this probably not a good approach to do what I
want.
I could write some stuff on C++, but I need a hint how to elevate rights
(maybe how to modify Access Token privileges or something like that) so that
to change that registry key in HKCU.
Thanks in advance,
Alex Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 183978
Creating folders using VB Script
Hello. I have a small task I need to do at work.
I have to create 2 folders within a folder structure. However I need to
create these 2 folders in EVERY SINGLE existing folder AND their
subfolders.
So let's say we have folders Parent1, Parent2 and Parent3, each has
sub-folders named Sub1 and Sub2. This script needs to create a folder
named New1 and New2 (examples) within all Parents and Subs. Also each
parent doesnt necessarily have 2 sub folders... some have 1, others
have 20.
Anyone know of a good way of doing this?
Cheers! Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 183976
How to enumerate moniker protocols ?
Hi,
In WinXP Pro, IIS 5.1 is managed by its own protocol, "IIS://", not by
"winmgmts://.../microsoftiisv2/...".
How should I enumerate moniker protocols with VBScript,
and what docs should I read to learn what to do with them ?
Thank you in advance for your reply. Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 183970
How to resize a .HTA ?
Hi,
I am looking at Scriptomatic 2.0 and it is a great sample of useful
.HTA-application.
I have long searched an easy way to write a non-primitive GUI in
something simpler than C++,
and Scriptomatic2 offers very useful patterns to borrow and follow.
Now I would like to resize my own .HTA window
and have all inputs/controls to obey this resizing.
F.e., in Scriptomatic2, 1st and 2nd rows should stick to top,
Language, Output Format, and bottom-right buttons should stick to right,
big script edit window should be resized in both dimensions,
and hostname-list window should be resized in width but not in height.
Please suggest me how should I specify this behaviour in layout,
or how should I handle events to implement this functionality.
Thank you in advance for your replies. Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 183969
Thank you all for your help
Dear people,
With your help I have got a lot of useful knowledge
about VBScript/WSH and other related stuff.
Special thanks to ekkehard.horner , LakeGator, Bob Barrows, James
Whitlow.
Now I understand what docs I should read further.
Hope I would get equally useful responses on my further questions.
Thank you a lot. Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 183968
LDAP Query Anomaly.
In trying to return postOfficeBox I came across this problem I still
can't explain... Perhaps someone can shed some light into this for me.
I ran the following script to query LDAP for postal address, postal
code, samaccountname, etc... Everything returns fine, except for
postofficebox.
I subsequently pulled a script off the MS site that returned the
postofficebox via enumerateusers function, but I don't understand why this
script just fails on postofficebox?
***************************************************************************Â**
Option Explicit
Dim objRootDSE, strDNSDomain, objConnection, objCommand, strQuery
Dim objRecordSet, strUserDN, strOS, strFilePath
' Determine DNS domain name from RootDSE object.
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
'msgbox strDNSDomain
' Use ADO to search Active Directory for all users.
Set objCommand = CreateObject("ADODB.Command")
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
objCommand.ActiveConnection = objConnection
strquery = "<LDAP://ou=angrc,ou=ang,dc=ang,dc=ds,dc=af,dc=mil" &
">;(objectCategory=user);" _
&
"cn,postalCode,sAMAccountName,userPrincipalName,postOfficeBox;subtree"
'msgbox strquery
objCommand.CommandText = strQuery
objCommand.Properties("Page Size") = 100
objCommand.Properties("Timeout") = 30
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
' Spreadsheet file to be created.
dim strExcelPath, objExcel, objSheet, i
strExcelPath = "c:\scripts\users.xls"
' Bind to Excel object.
On Error Resume Next
Set objExcel = CreateObject("Excel.Application")
If Err.Number <> 0 Then
On Error GoTo 0
Wscript.Echo "Excel application not found."
Wscript.Quit
End If
On Error GoTo 0
' Create a new workbook.
objExcel.Workbooks.Add
' Bind to worksheet.
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
objSheet.Name = "AD Users"
i = 1
' Enumerate user objects.
Do Until objRecordSet.EOF
strUserDN = objRecordSet.Fields("sAMAccountName")
i = i + 1
objsheet.cells(i, 1).value = strUserDN
objsheet.cells(i, 2).value = objRecordSet.Fields("postOfficeBox")
objsheet.cells(i, 3).value = objRecordSet.Fields("postalCode")
' End If
objRecordSet.MoveNext
Loop
objExcel.Columns(1).ColumnWidth = 20
objExcel.Columns(2).ColumnWidth = 30
objExcel.Columns(3).ColumnWidth = 30
objExcel.Columns(4).ColumnWidth = 30
' Save the spreadsheet and close the workbook.
objExcel.ActiveWorkbook.SaveAs strExcelPath
objExcel.ActiveWorkbook.Close
' Quit Excel.
objExcel.Application.Quit
' Clean up.
objConnection.Close
Set objRootDSE = Nothing
Set objCommand = Nothing
Set objConnection = Nothing
Set objRecordSet = Nothing
Wscript.Echo "Done"
********************************************************************* Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 183967
Copy to Clipboard via VBSCript?
Hello all,
Is it possible to copy a text to clipboard via VBScript?
i tired the following given in MSDN but this is not working
strCopy = "This text has been copied to the clipboard."
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("about:blank")
objIE.document.parentwindow.clipboardData.SetData "text", strCopy
objIE.Quit
Does any one have any other option?
Best Regards
Karthik Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 183959
ActiveX component can't create object: 'WScript.Shell'
Hi, I'm trying to Print a PDF through VBS.
I found related topics in this group. One solution I found was using
WshShell.RegRead(...)
But I'm getting following error for the code - Set WshShell =
CreateObject("WScript.Shell")
"ActiveX component can't create object: 'WScript.Shell'"
I don't know the reason. I'm new to vbs and the issue is urgent. Can
anyone help me?
(I've installed Windows Script 5.6 .. What else should I check?) Tag: The Balmar Rave. Developer's Rap Techno-Remix Tag: 183953