How To Tell If Running CScript or WScript?
I have a VB Script in which I only want to display certain messages if I'm
running under CScript. I use WScript.Echo to display these messages. If the
script is running under WScript, it opens the message box and I have to hit
"OK" to continue, so if the script is running under WScript, I do not want to
display these messages.
I'm looking for a way, in the script, to tell if it is running under CScript
or WScript. Is there some property that tells me which program the script is
running under? If not, is there any other way to accomplish this?
Thanks Tag: script for Com+ components Tag: 181689
How to read data from SQL db and write to a OWC component
I want to create a Excel OWC component and read data from the Orders
table of the Northwind database and write into the OWC (Office Web
Component) component from VBScript on a ASP page.
Can you kindly share the code.
Thanks
Karen Tag: script for Com+ components Tag: 181688
Best Expired domain finder
Find expired domains with the best software:
http://www.antssoft.com
The best domain names are already taken. But with expired domain software you can find the best domain names like:
--------------------------------
http://www.beyx.com
http://www.c6d.de
http://www.fyq.us
http://www.gv0.net
http://www.j1o.de
http://www.aj0.net
http://www.3tt.de
http://www.3ss.de
http://www.aryh.com
http://www.qym.us
http://www.f6x.de
http://www.60n.de
http://www.7ix.de
http://www.k9m.de
http://www.4bx.de
http://www.9kk.de
http://www.bx0.net
http://www.0ol.de
http://www.w6x.de
http://www.xub.us
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =--- Tag: script for Com+ components Tag: 181685
How to close file from vbs?
I know there must be a simple way to do this but so far I haven't found it.
I have a vbs file that writes output to an Excel file. All I want to do is
have the script close the file if it is open when the script is run.
Something like:
If test.xls is open
Close test.xls
Is this possible? Tag: script for Com+ components Tag: 181678
Create network neighborhood shortcuts depending on Group membership
I want to map drives without a drive letter in Network places. I have
the two parts (removing and adding shortcuts in nethood, but cannot get
the rights checker to work with them. Take a look at what I have...
' Clear all entries in the nethood folder
Const NETHOOD = &H13&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(NETHOOD)
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path & "\*.*"
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile(strPath)
*******
' create nethood shortcuts
Const NETHOOD = &H13&
Set objWSHShell = CreateObject("Wscript.Shell")
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(NETHOOD)
Set objFolderItem = objFolder.Self
strNetHood = objFolderItem.Path
strShortcutName = "Test Folder"
strShortcutPath = "\\testserver\p15141"
Set objShortcut = objWSHShell.CreateShortcut _
(strNetHood & "\" & strShortcutName & ".lnk")
objShortcut.TargetPath = strShortcutPath
objShortcut.Save
What I WANT to do is associate these with group
permissions. I need to create about 300 shortcuts for projects,
departments, proposals and so on. Groups are nested and in a w2k3
domain.The clients are w2k and XP. The share names are \\server1\share1
standard shares on w2k and w2k3 servers.
Thanks in advance, Tag: script for Com+ components Tag: 181673
PasteSpecial: values and formats possible in vbs?
I use the following code in vbs to copy and paste data from one Excel cell
to another:
XLBook.Worksheets("Sheet1").Select
XLBook.Worksheets("Sheet1").Range("A1").Copy
XLBook.Worksheets("Sheet1").Range("B1").PasteSpecial
My code above does a regular paste, but I need to do a paste special that
only pastes values and number formats. I've created a macro in Excel that
does this and the vba code for it is:
Range("A1").Select
Selection.Copy
Range("B1").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
However, the vba code above does not work in vbs. It throws an Expceted
Statement error at the first colon (:) in the PasteSpecial line. Does anyone
know how I can do this in vbs? Tag: script for Com+ components Tag: 181666
server.HTMLEncode Corrupts French Characters
Hello there,
I'm using server.HTMLEncode and I find that it corrupts the characters.
I added this to my page and it didn't work:
<meta http-equiv"Content-Type" content"text/html; charset=utf-8"/>
I tried it under Windows Server 2000 and Windows Server 2003, both failed.
How can I get HTMLEncode to work with the French Characters?
I will be much appreciated for the help.
Thank.
Kat Tag: script for Com+ components Tag: 181661
Save outlook messages as textfiles
I receive a forward email with several other emails as attachments.
I have a .vbs script that saves the e-mail to disk including the
attachments (several e-mails) in the mail. I would like to save the
mail like readable .txt files instead of the default .msg files.
I'm using the SaveAsFile propertie, but i'm not able to save the
attached .msg mails as plain text files.
if you have some vbs lines that could help me, that would be very nice
thanx
Leon Tag: script for Com+ components Tag: 181652
Excel Graph
I'm creating a jpg from a comma seperated input file.
The file is in the style
A,10,20
B,30,50
C1,21,40
C2,35,70
E,36,50
So has three values and is alphabetically listed with the first.
I'm creating the Excel graph with the following script
=================================================
DIM x(100)
DIM y(100)
DIM z(100)
vDate=Date()
LastMonth=DateAdd("m",-1,vDate)
vYear=Year(LastMonth)
vMonth1=Month(LastMonth)
vMonth=MonthName(vMonth1)
If vMonth1<10 then vMonth1="0"&vMonth1
Set oFS=CreateObject("Scripting.FileSystemObject")
inFILE="data.txt"
Set inputFILE=oFS.OpenTextFile(inFILE)
linecount=0
While Not inputFILE.AtEndOfStream
linecount=linecount+1
vline = inputFILE.Readline
If Len(vline)>0 then
splitline=split(vline,",")
x(linecount)=splitline(0)
y(linecount)=splitline(1)
z(linecount)=splitline(2)
End If
WEnd
inputFILE.Close
Set inputFILE=Nothing
Set oFS=Nothing
set loChartSpace = WScript.CreateObject("OWC10.ChartSpace")
set oConst = loChartSpace.Constants
set loGraph = loChartSpace.Charts.Add()
loGraph.Type = 3
loGraph.HasLegend = True
loGraph.PlotArea.Interior.Color = "azure"
loChartSpace.HasChartSpaceTitle = True
loChartSpace.ChartSpaceTitle.Caption = "Values - "& vMonth & ", "&vYear
loChartSpace.ChartSpaceTitle.Font.Bold = True
Set objAxis = loGraph.Axes(oConst.chAxisPositionBottom)
'Axis Properties
With objAxis
.HasTitle = True
.Scaling.Maximum=100
.Title.Caption = "Percent"
.Font.Size = 6
End With
Set objAxis = loGraph.Axes(oConst.chAxisPositionLeft)
'Axis Properties
With objAxis
.HasTitle = True
'.Scaling.Maximum=100
.Title.Caption = "Values"
.Font.Size = 8
End With
loGraph.SeriesCollection.Add()
loGraph.SeriesCollection(0).Caption = "In"
loGraph.SeriesCollection(0).Interior.Color = "#66ccff"
loGraph.SeriesCollection(0).SetData oConst.chDimCategories,
oConst.chDataLiteral, x
loGraph.SeriesCollection(0).SetData oConst.chDimValues,
oConst.chDataLiteral, y
loGraph.SeriesCollection.Add()
loGraph.SeriesCollection(1).Caption = "Out"
loGraph.SeriesCollection(1).Interior.Color = "#000099"
loGraph.SeriesCollection(1).SetData oConst.chDimValues,
oConst.chDataLiteral, z
lcFile = "D:\rank\graphs\"&vYear&vMonth1&".jpg"
loChartSpace.ExportPicture lcFile,"jpg",800,600
=========================================================
Most of which has been found on the internet (so if you see some of your own
code in there - thanks!!!!!!!)
The thing is I'm setting loGraph.Type = 3 which is sideways columns.
The problem I'v got is that the values in the first column of the csv
(alphabetical) are displayed in reverse (top to bottom) on the graph.
So the graph show in the left column :
E
C2
C1
B
A
It seems to be OK if I choose loGraph.Type = 0 (columns going up) with the
bottom axis showing A,B,C1,C2,E
Is there any way I can flip the data simply so when I've got loGraph.Type =
3 the left axis is alphabetically downwards?
Many Thanks Tag: script for Com+ components Tag: 181650
Daily backup
Hi everyone
I have XP Pro SP2 and would like to schedule an automatic backup of the "My
Documents" folder to a USB memory stick (in effect, it's my G: drive when I
check via Windows Explorer). I have a memory stick inserted throughout the
day. When the copy of the whole folder occurs, I'd like to have it named as
<Day, date at time> (taken from the computer's current time settings) such
as "Wednesday, 5 October 2005 at 0927". I've searched for scripts to do
such a copy but, as my knowledge of scripts is negligible, I need guidance.
I'd envisage running the script via Scheduler but can this all be done? Is
it a good idea? Can someone give me a nudge to start this project?
Thanks for your time and patience. Tag: script for Com+ components Tag: 181649
AD user parameters
Hi there
When I create a user in AD via a script I can tell his (her) firstname,
lastname, username etc
I want to add his (her) email adress, description, office.
What's the name of the fields? or where can I find them?
Thanks
Phil Tag: script for Com+ components Tag: 181648
Export and import DHCP configuration
Hi there
I need to backup my dhcp datas to be able either to reload them in case
of problem on my DHCP service or to load them on another DHCP server in
case of crash of my DHCP server.
I'd like to record the datas in a text file to be able to modify it
easily (In case of crash I'll need to change the range of my dynamic IP
adresses).
Thanks in advance
Phil Tag: script for Com+ components Tag: 181647
HTA Minimize IE window method ??
I've searched high and low without success for a HTA method that will
Minimize and then Maximize the active HTA window.
Can someone point me to a URL or detail how to perform this task? Tag: script for Com+ components Tag: 181646
Creating a shortcut icon in All users start menu?
Hi.
I would like to add a few icons to the "All users" start menu using a
VBScript.
Are there any examples i can have a look at.
What i especially need is to know.
1.
How can i find out the correct path to X:\document and settings\All
users\Start menu\ using some variable?
2.
how do i create and place a shortcut in the start menu?
thanks in advance
k Tag: script for Com+ components Tag: 181645
Enable DNS Server automatically
Hi Group
I want to Write a script to automatic enbale the "DNS Server Address" and
enter a fixed server IP as "172.18.2.1"
Please help me for this.
Regards
Kathy Tag: script for Com+ components Tag: 181644
Script to Update Driver
Hi Group
I want to Write a script to Update the driver of keyboard.
Right now I am doing it manually by going in control panel and selecting
the keyboard, right click and cliking on the "Update driver" option fron the
specefic location.
I want to do it automatically, Can anyone help me for this.
Thanks and Regards
Kathy Tag: script for Com+ components Tag: 181643
Need Help getting PC data into a file
Hi There
I am very very very new to scripting. If any one can guide me in the
right direction I will really really appreciate.
I am building a sql data base of my computers at work (about 1000) of
them.
I was wondering if I can write a batch file, which will get me the
following info into a text file
Ram
MAC
HD size
Proc speed
Does nay one know how?
THx a lot Tag: script for Com+ components Tag: 181638
Script bombs if user not member of any groups
I have a script that deletes a specific group from user accounts. It works
(deletes the group, if present) as long as the user account is a member of
any other group besides Domain Users. The script bombs if the user not member
of any group (other than Domain Users) at this line:
arrMemberOf = ouser.GetEx("memberOf")
The error is:
Active Directory: The directory property cannot be found in the cache.
How can I get my script to finish? Tag: script for Com+ components Tag: 181635
Unable to register vbscript.dll
I attempt to register vbscript.dll using regsvr32 but I'm unable to. I get
the error DllRegisterServer failed. Is there any solution to get around
this? Tag: script for Com+ components Tag: 181634
I'm unable to register vb or jscript.dll
I cannot use regsvr32 in a Windows XP Home environment to register said .dll
files. The unit I'm working on currently has multiple spyware infections.
Without being able to register these files I'm unable to install certain
spyware programs. Any ideas as to why this is happening? I tried to
reinstall Windows Scripting 5.6 to no avail. Tag: script for Com+ components Tag: 181631
Unable to add a Variable to a SELECT statement
Hi, I'm learning VBScript by actually writing "proof of concept" code for
work. One VBScript piece has my head being driven mad. It must be simple
but I can't find any code on the web (I might be looking in the wrong
place). Staff save work files and folders to an individual folder on a
server - this needs deleting every so often.
Eventually I will connect this code with an excel spreadsheet and loop
through possibly hundreds of folders and contents to be deleted. The
problem is how to add the variable: "strDelete" to the SELECT part of the
statement (assuming I have got that peice of code right?)
Here's what I have so far.
========================================================================
On Error Resume Next
dim strComputer, strStaff, strOffice, strDelete
strComputer = InputBox("Please enter a workstation number")
strOffice = InputBox("Please enter a staff number")
strStaff = InputBox("Please enter a staff number")
strDelete = "\\" & strComputer & "\e$\data\" & strOffice & "\users\" &
strStaff
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFolders = objWMIService.ExecQuery ("SELECT * FROM Win32_Directory _
WHERE Name = 'strDelete' ")
For Each objFolder in colFolders
errResults = objFolder.Delete
Wscript.Echo errResults
Next
' example of path: \\<strServer>\e$\data\<strOffice>\users\<strStaff>
' real example: \\london01\e$\data\OxfordRoad\users\MatthewsFolder
=========================================================================
TIA
James Tee Tag: script for Com+ components Tag: 181627
Excel AddIns.Add problem
Hi! :-)
I've made a installation script for a templates package we use. It includes
a .xla file (= an Excel Add-In).
When I started testing the script on the rest of the It dept two (of 20+)
got an error. Not in my script but in the .xla code:
I install the add-in with:
If objFileSystem.FileExists(strFileName) Then
Set objExcel = CreateObject("Excel.Application")
objExcel.Workbooks.Add
Dim objAddIn : Set objAddin = objExcel.AddIns.Add(strFileName,True)
objAddIn.Installed = True
On Error Resume Next
Dim objAddInWorkbook : Set objAddInWorkbook =
objExcel.Workbooks(objExcel.AddIns(objAddIn.Name))
If Err <> 0 Then Set objAddInWorkbook =
objExcel.Workbooks.Open(objAddIn.FullName)
On Error Goto 0
objExcel.Quit
End If
The error seemes to occur in Excel when the "Set objAddInWorkbook =
objExcel.Workbooks.Open(objAddIn.FullName)" row is run.
The error message in excel is:
Run-time error '-2147467259 (80004005)':
Metod 'OnAction' of object '_CommandBarButton' failed
I would prefer to solve this problem by changing my script but if it's
easier/possible in the -xla file.
Here's the sub where the problem occurs, it's started from the workbook_open
sub, I don't know if it's also run automatically or not:
Private Sub Load_Menus()
Dim myMenuBar As CommandBar
Dim newMenu As CommandBarControl
Dim ctrl1 As CommandBarButton
Dim ctrl2 As CommandBarButton
Dim ctrl3 As CommandBarButton
Dim ctrl4 As CommandBarButton
Dim mnuMenu As CommandBarControl
Dim mnuMenuItem As Variant
Set myMenuBar = Application.CommandBars.ActiveMenuBar
Set newMenu = myMenuBar.Controls.Add(Type:=msoControlPopup,
Temporary:=True)
newMenu.Caption = "&Leanstream"
Set ctrl1 = newMenu.Controls.Add(Type:=msoControlButton, ID:=1,
Temporary:=True)
ctrl1.Caption = "&Spara som nytt dokument i e-pärm"
ctrl1.OnAction = "ThisWorkbook.GetMyProjects"
Set ctrl2 = newMenu.Controls.Add(Type:=msoControlButton, ID:=1,
Temporary:=True)
ctrl2.Caption = "&Checka in och stäng dokumentet"
ctrl2.OnAction = "modCheckIn.CheckaIn"
Set ctrl3 = newMenu.Controls.Add(Type:=msoControlButton, ID:=1,
Temporary:=True)
ctrl3.Caption = "&Uppdatera fält i dokumentet"
ctrl3.OnAction = "modDocOpen.DocOpen"
Set ctrl4 = newMenu.Controls.Add(Type:=msoControlButton, ID:=1,
Temporary:=True)
ctrl4.Caption = "&Hjälp om Leanstreamfunktioner"
ctrl4.OnAction = "ThisWorkbook.VisaHjalp"
'Knöligt men nödvändigt. Om man använder
Application.CommandBars.FindControl(ID:=748).OnAction =
"ThisWorkbook.LSArkivSparaSom" så funkar det inte!
If Application.CommandBars.FindControl(ID:=748).Caption = "Spara
so&m..." Then
Application.CommandBars("Worksheet Menu
Bar").Controls("&Arkiv").Controls("Spara so&m...").OnAction =
"ThisWorkbook.LSArkivSparaSom"
ElseIf Application.CommandBars.FindControl(ID:=748).Caption = "Save
&As..." Then
Application.CommandBars("Worksheet Menu
Bar").Controls("&File").Controls("Save &As...").OnAction =
"ThisWorkbook.LSArkivSparaSom"
End If
End Sub
The row Excel marks yellow is "ctrl1.OnAction =
"ThisWorkbook.GetMyProjects"".
I solved the proplem on one of the machines by adding the .xla manually.
Though the whole point of this is not to have to do things manually so any
input's welcome!! :-)
Thanks a million! :-)
/Sofia Tag: script for Com+ components Tag: 181623
Cluster Monitoring
Has anyone come across a script to monitor cluster wmi events to per4form
notification when a cluster failsover?
Paul Tag: script for Com+ components Tag: 181621
Replace / with , in a text file
I need to open every *.log file in a folder and replace all occurances of
"/" with a "," inside a text file. Each .log file probably has 2000 lines.
I am officially lost.
Is there a simple solution for this? Any ideas where I can info on how to do
this?
Thanks
Steve Tag: script for Com+ components Tag: 181618
retreive contents of add/remove programs
Hi,
Is there a sample script that I could run over a large network reporting
what is registered in add/remove programs on each workstation? Perhaps via
a GPO?
TIA Tag: script for Com+ components Tag: 181615
How to create a self extracting zip file that starts excel with a macro
I have created a pivot report against a .CSV data file.
Everymonth I want to email the combination of the CSV file and the
Excel pivot report to our users. So once the user clicks on the zip
file it must save the CSV file in say c:\temp and then save the Excel
pivot report as well in c:\temp and the Excel workbook pivot report
start against the file in C:\temp
Please help with code how I can do this.
Thanks
Karen Tag: script for Com+ components Tag: 181611
Copying Folders by Using the Shell Folder Object
Hello
I am copying folders like:
objFolder.CopyHere "C:\Scripts", &H100&
I want to pass more than one argument, e.g &H100& and &H4&.
How do I do that?
Thanks in advance
/Svensson Tag: script for Com+ components Tag: 181607
Script in .asp updating records in Access database
Hi,
New to ASP and VB script and an amateur, so please forgive.
I'm trying to make a competition results section for my golf club's web
site. I've constructed an Access database with a table (tbl2005) which
holds competition results in eight fields: ID (key), date1, day, event1,
Agrade, Bgrade, Cgrade and NTP.
I've successfully made .asp pages that will add records to the table
(via a form) and delete a record. Now I'm trying to make one to update a
record that might have been added incorrectly.
I've got an .asp page that will bring up the records in a table so one
can be selected for updating, and then one that places the selected
record fields in a form so the record can be altered. These seem to work
correctly.
Then I've got the following page (make_update.asp) to process the
amended form and update the table.
========================================================================
<%
Dim ID,date1,day,event1,Agrade,Bgrade,Cgrade,NTP
ID = Request.Form("ID")
date1 = Request.Form("date1")
day=Request.Form("day")
event1 = Request.Form("event1")
Agrade = Request.Form("Agrade")
Bgrade = Request.Form("Bgrade")
Cgrade = Request.Form("Cgrade")
NTP = Request.Form("NTP")
Dim Conn ,Rs, sql
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="&
Server.MapPath("results.mdb")
sql= "Update tbl2005 Set date1='"& date1 & "', day='"& day & "',
event1='"& event1 & "', Agrade='"& Agrade & "', Bgrade='"& Bgrade & "',
Cgrade='"& Cgrade & "', NTP='"& NTP & "' where ID="&ID
Conn.Close
Set Rs=Nothing
Set Conn = Nothing
Response.Write "Competition list has been updated"
End If
%>
========================================================================
However, while it gives the "success" message, it doesn't update the
record in the table.
The problem seems to be in the "sql= ..." line. Any suggestions?
--
Thanks
Colin Wilson
------------------------------------------------------------------
Trentham Golf Club: http://www.trenthamgolf.com
------------------------------------------------------------------ Tag: script for Com+ components Tag: 181602
Adding a new printer share then remove old
The situation I'm in is we are renaming all our printers and shares. I have
used in the past a script that checks for the old printer, installs the new
one, checks for if it was a default then deletes the old. Unfortunately
this was when we where changing server names and the difference is we are
keeping the same server name but changing the printer names and shares.
However I can't seem to get this script working because the old printer name
no longer exists because it has been renamed. Is there a way around this?
Below I have a copy of our test script
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer")
For Each objPrinter in colPrinters
on error resume next
If Lcase(objPrinter.name) = Lcase("\\appprint\test1") Then
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection "\\appprint\testprint1"
Else
If Lcase(objPrinter.name) = Lcase("\\appprint\test2") Then
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection "\\appprint\testprint2"
End If
End If
Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer Where
Default = TRUE")
For Each objPrinter in colPrinters
If Lcase(objPrinter.name) = Lcase("\\appprint\test1") Then
Set objNetwork = CreateObject("WScript.Network")
objNetwork.SetDefaultPrinter "\\appprint\testprint1"
Else
If Lcase(objPrinter.name) = Lcase("\\appprint\test2") Then
Set objNetwork = CreateObject("WScript.Network")
objNetwork.SetDefaultPrinter "\\appprint\testprint2"
End If
End If
Next
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer")
For Each objPrinter in colPrinters
on error resume next
If Lcase(objPrinter.name) = Lcase("\\appprint\testprint1") Then
Set objNetwork = CreateObject("Wscript.Network")
objNetwork.RemovePrinterConnection "\\\appprint\test1"
Else
If Lcase(objPrinter.name) = Lcase("\\appprint\testprint2") Then
Set objNetwork = CreateObject("Wscript.Network")
objNetwork.RemovePrinterConnection "\\appprint\test2"
End If
End If
Next Tag: script for Com+ components Tag: 181597
hopefully simple update of AD through vbscript?
We are running MS Exchange (2003?) that has added some
extensionAttributes to Active Directory. One group started
using those extenstionAttributes and now the values need pushing
down. I have been tasked with moving attributes 3->5 -> 5->8,
meaning put the value from 3 into attrib 5, the value from 4
into attrib 6, the value from 5 into attrib 7. All the touched
users are in the same OU. Seems I should be able to:
attach to ADS
create some sort of query for all users in OU
update each user setting
attrib8 = ''
attrib7 = attrib5
attrib6 = attrib4
attrib5 = attrib3
attrib4 = ''
attrib3 = ''
end user
end loop
If I AD were a database I could connect to:
update users set attrib7 = attrib5 where ou = OU;
update users set attrib6 = attrib4 where ou = OU;
update users set attrib5 = attrib3 where ou = OU;
update users set attrib4 = '' where ou = OU;
update users set attrib3 = '' where ou = OU;
I've done a little vbs, but not this much.
Anyone have this code or code that can be easily
adapted to this?
Mike Tag: script for Com+ components Tag: 181591
Editing a GPO
I need to create and edit a GPO.
The creating part I have:
sGPO = "Outlook Web"
set oGPM = CreateObject("GPMgmt.GPM")
set oGPMConstants = oGPM.GetConstants()
set oGPMDomain = oGPM.GetDomain(DomainName, "", oGPMConstants.UseAnyDC)
set oGPO = oGPMDomain.CreateGPO()
oGPO.DisplayName = sGPO
That part is ok. The part that is kicking MY tail is scripting a piece
that EDITS a value in that GPO. I need to change the location of the
Start Menu folder, redirect it to a specific location.
I have gone through the GPMC .chm file, and am now just really confused!
heh heh
Can anyone give me a hand with this?
TIA,
DS
---
Life is all about ass; you're either covering it, laughing it off,
kicking it, kissing it, busting it, trying to get a piece of it,
behaving like one, or living with one!
*** Sent via Developersdex http://www.developersdex.com *** Tag: script for Com+ components Tag: 181588
Dynamic Window/Control Updates
Does anyone know how to dynamically create and update an HTA form?
I want to update a field repetitively for longer processes and I don't
want to use a backend ASP script. Tag: script for Com+ components Tag: 181586
Forward events in real time
Hi,
I want the events in Security log to be forwarded in real time to a
database/evt format /text file. How to do it with a script?
Thanks,
Wensi Tag: script for Com+ components Tag: 181582
Remove DHCP Leases with script
I am trying to write a script that will remove leases from our DHCP server.
We have many notebook computer leases that have to be cleaned out often. We
currently do it maunally, but a script would sure be easier. Thanks for any
ideas.
--
Wildflower
MCSE 2004 Tag: script for Com+ components Tag: 181580
How to copy/paste from one file to another
I need to copy cells from an Excel csv file and paste them into an Excel xls
file. Does anyone know how this can be done using vbs?
Thanks... Tag: script for Com+ components Tag: 181579
IE history and typed URL erase
Need help witht his script:
I want it to automatically select yes and delete all clear typed URLs
and not prompt for user. And second part of script opens IE history. On
that I would like it to select all and delete. I am using this script
as a log off for students in a classroom.
Thanks
On Error Resume Next
strExplain="ClearTypedURL clears individual items from the history of
URLs typed into Internet Explorer." & vbCRLF & "The program will prompt
for each item in the list." & vbCRLF & vbCRLF
strTitle="Clear Run MRU"
Dim Sh
Set Sh = WScript.CreateObject("WScript.Shell")
ReportErrors "Creating Shell"
Sh.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\"
& Wscript.ScriptName & "\", Chr(34) & Wscript.ScriptFullName & Chr(34)
Sh.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\"
& Left(Wscript.ScriptName, Len(Wscript.ScriptName)-3) & "exe" & "\",
Chr(34) & Wscript.ScriptFullName & Chr(34)
ReportErrors "Updating App Paths"
NoOfURLs=0
x=1
Do
t=Sh.RegRead("HKCU\Software\Microsoft\Internet
Explorer\TypedURLs\Url" & CStr(x))
If Err.Number=-2147024894 then
Err.Clear
Exit Do
Else
NoOfURLs=NoOfURLs + 1
x=x+1
End If
Loop
If MsgBox (strExplain & "Number of entries" & vbtab & NoOfURLs & vbCRLF
& vbCRLF & "Continue?", vbYesNo + vbInformation, strTitle) = 6 then
Dim MRUItem()
ReDim Preserve MRUItem(0)
For x=0 to NoOfURLs - 1
MItem=Sh.RegRead("HKCU\Software\Microsoft\Internet
Explorer\TypedURLs\Url" & CStr(x +1))
Sh.Regdelete "HKCU\Software\Microsoft\Internet
Explorer\TypedURLs\Url" & CStr(x + 1)
If MsgBox ("Do you want to delete " & vbcrlf & vbcrlf &
MItem & vbcrlf & vbcrlf & "Yes" & vbtab & "To delete" & vbcrlf & "No" &
vbtab & "To keep", vbYesNo + vbQuestion, strTitle) <> 6 then
ReDim Preserve MRUItem(UBound(MRUItem)+1)
MRUItem(UBound(MRUItem))=MItem
End If
Next
If UBound(MRUItem) > 0 Then
For x=1 to UBound(MRUItem)
Sh.RegWrite "HKCU\Software\Microsoft\Internet
Explorer\TypedURLs\Url" & CStr(x),MRUItem(x)
Next
End If
If MsgBox ("Visited URLs are also stored in the History folder.
Each item can be deleted there." & vbcrlf & vbcrlf & "Open History
folder?", vbYesNo + vbQuestion, strTitle) = 6 then
Sh.Run "Explorer /e,/root," & Sh.RegRead
("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell
Folders\History")
End If
End If Tag: script for Com+ components Tag: 181578
Running a vbscript on a remote XpPro computer. Error: remote ser
I am as scripting newbie trying to run a vbscript from a computer named
"Alpha" on a remote computer named "Zappa" in my lan.
I get the error message: "Error: The remote server machine does not exist
or is unavailable: 'GetObject', Code: 800A01CE, Source: Microsoft VBScript
runtime error OK"
We're on a win2k server. Both Alpha and Zappa are running WinXpPro, and are
completely updated.
Each computer sees the other in My Network Places.
I placed the remote script ("Logoff.vbs") into the Windows folder of the
remote computer ("Zappa"), to avoid any questions about finding the path to
the script.
I am logged into Alpha as "Marxp" which is an administrator on both
computers.
Here's the script I'm running on Alpha (which I cannibalized from the web):
strRemoteComputer = "Zappa"
strWorkerScript = "Logoff.vbs"
Set objWshController = WScript.CreateObject("WshController")
Set objRemoteScript = _
objWshController.CreateScript(strWorkerScript, strRemoteComputer)
objRemoteScript.Execute
Do While Not objRemoteScript.Status = 2
Wscript.Sleep(100)
Wscript.Echo "Remote script not yet complete."
Loop
Somewhere on the web, I saw something about a program called "poledit.exe",
but (being a newbie at this), I did not know where to find it or what to do.
Any pointers would be much appreciated.
marc ee poo Tag: script for Com+ components Tag: 181575
Way to execute asp pages
I'm looking for a way to execute asp pages outside from browser.
I can't save them to .VBS extension because of little diferences
(server.createobject and other some little differences)
Final objective is to schedule execution of this page that do some
processes and I should avoid schedule opening browser to exec it...
Any help appreciated.
--
Gibe si è fatto passare perchè Rossi dietro è come una purga, prima o
poi una cagata te la fa fare...! Tag: script for Com+ components Tag: 181569
Configure Windows Explorer
hey guys,
where can i find hints about configuring windows explorer? need such things
as satusbar enable, view all documents/folders... don´t want to click this
every time on a new pc.
thanks for your help!
Flo Tag: script for Com+ components Tag: 181568
Running a vbscript on a remote XpPro computer. Error: remote server machine does not exist or is unavailable
I am trying to run a vbscript from a computer named "Alpha" on a remote
computer named "Zappa" in my lan.
I get the error message: "Error: The remote server machine does not exist
or is unavailable: 'GetObject', Code: 800A01CE, Source: Microsoft VBScript
runtime error OK"
We're on a win2k server. Both Alpha and Zappa are running WinXpPro, and are
completely updated.
Each computer sees the other in My Network Places.
I placed the remote script ("Logoff.vbs") into the Windows folder of the
remote computer ("Zappa"), to avoid any worries about finding the path to
the script.
I am logged into Alpha as "Marxp" which is an administrator on both
computers.
Here's the script I'm running on Alpha (which I cannibalized from the web):
strRemoteComputer = "Zappa"
strWorkerScript = "Logoff.vbs"
Set objWshController = WScript.CreateObject("WshController")
Set objRemoteScript = _
objWshController.CreateScript(strWorkerScript, strRemoteComputer)
objRemoteScript.Execute
Do While Not objRemoteScript.Status = 2
Wscript.Sleep(100)
Wscript.Echo "Remote script not yet complete."
Loop
Somewhere on the web, I saw something about a program called "poledit.exe",
but (being a newbie at this), I did not know where to find it or what to do.
Any pointers would be much appreciated.
marc ee poo Tag: script for Com+ components Tag: 181567
vbscript and task scheduler
I have a script that runs just fine when I run it manually. I tried to
create a schedule task for this so it would run nightly, and when the
scheduler executes it the processor goes to 100% cpu and stays there
and the script never completes. I can't see it being a permissions
issues because the script starts. I have never had this prolem with
any other script. The script it'self is simple, it quries a database
and writes the results to excel. I can see the excel process gets
started but again it never completes.
Anyone have any ideas???? Tag: script for Com+ components Tag: 181558
AD, the last date in that a PC was lit / started
I need a script, to know through the AD, the last date in that a PC was lit
/ started. I have five domain controllers.
Thank you in advance Tag: script for Com+ components Tag: 181557
Unable to read program's output
I'm trying to shell out and run an exe and read its ouput. What I'm
finding is that my VBS script is unable to see any of the text
normally seen when running the program from the console. This is a
simplified version of the code:
Dim exec, s0, somepgm, inputfile
somepgm = "C:\Program Files\somepgm.exe"
inputfile = "C:\data\somefile.ext"
Set shell = CreateObject("WScript.Shell")
Set exec = shell.Exec("""" & somepgm & """ """ & inputfile & """")
Do While exec.Status = 0
WScript.Sleep 100
Loop
Do Until exec.StdOut.AtEndOfStream
s0 = exec.StdOut.ReadLine
WScript.Echo "s0: " & s0
Loop
I've also noticed that I can't capture any of the program's output if
I run it from the command line using a file redirect:
C:\>"C:\Program Files\somepgm.exe" "C:\data\somefile.ext" >output.txt
This generates an empty file. Any ideas how I can read the output? Tag: script for Com+ components Tag: 181555
Problem with Enumerating Software
Hi,
I have run this snippet on both XP machines and Small Business Server 2003.
Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product")
wscript.echo "Count " & colSoftware.count
When running it on XP, I get a count of software packages installed. When
run on the SBS server, I get an invalid class error when trying to display
the count. (The same thing happens when trying to display the items in the
collection.) Is there a way to get a listing of the software installed on a
server?
Thanks Tag: script for Com+ components Tag: 181553
Need event after back button
I need the event or coding when a page is returned to.
Example, in vbscript I add some highlighting to the page.
If a link on the page is fired then the linked page comes up,
then if hit back button, I get original page back but without
the highlighting. I've tried to look at things like the onactivate (which
works)
but that requires that the page returned to be clicked on with
the mouse. What event routines or coding might be available
upon just returning to a page with the back button? So that
I can have it recall my highlighting routine, so that the page
can then look the same as they left it.
TIA,
mtnw Tag: script for Com+ components Tag: 181550
Sorting strings in vbscript
I have a string containing a list of items in it seperated by vbcrlf. Can
anyone think of a clever/elegant way to sort that list? Tag: script for Com+ components Tag: 181544
Join the domain
Hey all:
Is it possible that a VBS script be written to move a machine from one
domain to another (And into an ou that is different from the default
workstations ou) ex from abc to ad remotely and not reboot the machine?
THanks for any suggestions. Tag: script for Com+ components Tag: 181536
Changing Font Color and clearing screen
Hello all,
I am running vbs scripts from the command line using cscript. Is it possible
to send commands to the command interpreter such as clear screen (CLS) and
change color of lines as the script progresses and writes output all without
calling a second cmd from the script?
THX Tag: script for Com+ components Tag: 181535
Hi, Any script for list status of components com+?