Get the default user name of pc using a text file contain a hostname list
Here is my dilemma...
I have a text file with all the pc's i need to get the
default username using the registry.
The key is HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon
and the reg value to read is DefaultUserName.
I need to output the results in a file like:
hostname,username
The hostname would be gathered from the text file, so I
dont need to query for it.
Any ideas how? Tag: MS Image Resizer Tag: 148695
Windows Environment Variable
Hi! I've worked with VBA for a while now, but am brand new to VBScript.
How do I use windows environment variables in VBScript? In VBA/VB, you have
the "Environ()" function, which I guess is not in VBScript. (I have one
called "ddssrvr", which returns the name of a server)
What I'd like to to do is change the HREF attribute of the <BASE> tag when
the window loads - evaluating the value of "ddssrvr" and using it to create
the <base> href URL. The .htm document I want to use this is will be part
of an compiled HTML help file - I don't know if this would cause additional
problems.
Thanks for any help with this! --- Francis Parsons Tag: MS Image Resizer Tag: 148692
WMI Broken?
I have a VBS script that runs on all of our XP
workstations except for one.
When ever the following line is executed.
Set oReg=GetObject("winmgmts:\root\default:StdRegProv")
I get this error.
"The specified module could not be found."
I tried re-applying Service Pack 1 for XP but I still have
the asme problem.
Is WMI busted on this PC?
Does anyone know of a fix?
Thanks
Mike Tag: MS Image Resizer Tag: 148687
popup not working
The following line doesn't dismiss my Popup after one second when called
from my html. It does work however when run on the desktop in VBScript. What
I was looking for was just a brief message indicating a program was started
and running. Instead I get a Popup I must dismiss manually. What gives?
CreateObject("WScript.Shell").Popup "Running: " & MyProg , 1, "Publish
KCenter", 64
Parameter "64" gives me button OK and the information icon. Is there a way
to call a Popup without any button?
thanks
LJB Tag: MS Image Resizer Tag: 148683
Problems with date(), datevalue(), formatdatetime() in VBScript 5.6
Hi,
I wrote a few scripts some time ago and now I just wanted to make them better.
While I've been testing the scripts, something weired was going on since the
scripts didn't work as expected anymore. Now I found out, that it is my machine
that is stupid (the scripts are working on every other machine!!!).
This little script workes on every machine I tested.
today = Date()
datum = datevalue(today)
wscript.echo "Die Variable 'datum' ist vom Typ: " & vartype(datum)
wscript.echo "Die Variable 'today' ist vom Typ: " & vartype(today)
Both variables are of Type "7" (Date) but on my machine I get an runtime error
in Line 2 "Type mismatch" (datevalue) Code: 800A000D
Can anybody help?? I just reinstalled Windows Script 5.6 and this behaviour
still occures only on my machine. Tag: MS Image Resizer Tag: 148675
Object browser and registry
Where can I locate documentation about Object Browser and the way to use it?
I used Object Browser inside Word to look at objects.
I addes the Scripting library to the list of available lists.
I noticed that I can look at several classes.
However, class FileSystemObject have a corresponding entry in the registry
under HKEY_CLASSES_ROOT, (Scripting.FileSystemObject) while I don't see an
entry in the registry for the Files class: is it registyered with a
different name? How can I locate the entry in the Registry associated with
a specific class?
Second question: looking in the Registry I don't see anything in the
Scripting.FileSystemObject and in the Scripting.FileSystemObject .CLSID
keys: is it correct?
Regards
Mario Tag: MS Image Resizer Tag: 148670
VBS / WSHost FTP Help ..
Hello there ..
I'm using the following the VBS script to retrieve a file from a
remote website. Everything works fine - almost. The problem is that
the file naming convention of the file I'm retrieving is date stamped
with the date and time the file was created. Here's the naming
convention for files in the outgoing account:
CompanyName_MMDDYY_hhmmss.txt (ie
CompanyName_MonthDayYear_HourMinuteSecond.txt)
Example: FordMotor_102403_150100.txt
Since I retrieve files on a daily basis I obviously know the first
half of the file name, but since I don't know exactly when the file is
created I don't know the 2nd half.
I've tried this without success:
RemoteFile = "SomeCompany_" + mm + dd + yy + "_" + ****** + ".txt"
Here's the full script below:
*************************************************
Option Explicit : Dim LocalDir, FTPaddr, UserName, Password, BaseDir
Dim args, fso, ws, InFile, ftp, OutFile, f, TextFile, ofile, oName
FTPaddr = "ftp.SomeCompany.com"
LocalDir = "D:\Inetpub\CompanyName\Import\"
UserName = "XXXXXXXXX"
Password = "XXXXXXXXX"
Set args = WScript.Arguments
Set fso = CreateObject("Scripting.FileSystemObject")
Set ws = CreateObject("WScript.Shell")
InFile = fso.GetSpecialFolder(2) & "\" & fso.GetTempName
Set ftp = fso.OpenTextFile(InFile, 2, True)
OutFile = fso.GetSpecialFolder(2) & "\" & fso.GetTempName
'--Create the target remote file to look for
Dim mm,dd,yy, RemoteFile
mm = Month(now)
dd = Day(now)
yy = Right(Year(now),2)
if mm < 10 then
mm = "0" & mm
end if
if dd < 10 then
dd = "0" & dd
end if
RemoteFile = "SomeCompany_" + mm + dd + yy + "_" + ****** + ".txt"
LocalDir = LocalDir & RemoteFile
' File nameing convention: SomeCompany_MMDDYY_HRMMSC.txt
Download()
ws.Run "%comspec% /c ftp -i -s:" & InFile & " >" & OutFile, 0, True
Cleanup() 'Release objects and exit
'---------Subs----------------------------------------------------
Sub Download()
With ftp
.WriteLine "open " & FTPaddr
.WriteLine UserName
.WriteLine Password
.WriteLine "binary"
.WriteLine "get "
.WriteLine RemoteFile
.WriteLine chr(34) & LocalDir & chr(34)
.WriteLine "close"
.WriteLine "bye"
.Close
End With
End Sub
Sub Cleanup()
On Error Resume Next
fso.DeleteFile InFile, True
fso.DeleteFile OutFile, True
fso.DeleteFile BaseDir, true
Set args = Nothing
Set fso = Nothing
Set ws = ""
Set ftp = ""
WScript.Quit
End Sub
********************************************
Thanks you kind people !!!!!!!!!!!!!!!!!!
Bill Tag: MS Image Resizer Tag: 148668
VBscript versions
I am confused about VBscript versions.
As I understand, installing a standard ("vanilla") Windows 2000 or XP I
install WSH 2.0, is it correct?
Should I install VBscript 5.6? Does it mean I install WSH 5.6?
What is the advantage?
Why do version numbers skip from 2.0 to 5.6? Is there anything else between
2.0 and 5.6?
Regards
Marius Tag: MS Image Resizer Tag: 148666
Retrieving the computer name
Hi guys,
I would like to retrieve the computer name on a whole lot of pcs. The
problem is I cannot use a networking object to retrieve it because some of
the pcs have their network card disabled. I work in retail as a pos support
guy, and we get info from the stores pcs through dialup.
Is there any way to get the host name or computer name of these machines
without doing a query to a network adapter?
Any help greatly appreciated.
I have tried the following:
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled =
True")
For Each objAdapter in colAdapters
Wscript.Echo "Host name: " & objAdapter.DNSHostName
Next
This works for a pc which has their network adapter card enabled, but even
if I change it to FALSE, for disabled card, it does not return it.
Simon
--
---------------------------------------------------------------------
"Are you still wasting your time with spam?...
There is a solution!"
Protected by GIANT Company's Spam Inspector
The most powerful anti-spam software available.
http://mail.spaminspector.com Tag: MS Image Resizer Tag: 148665
More help! Please.....
Ideally guys, I would like to input the information into the one file, but
all on the same line, with a comma in between each entry.
I would like to do this because I have over 150 systems, and I would like to
get all this information into a spreadsheet.
inventory.bat
cscript //NoLogo .\os.vbs >> .\inventory.txt
cscript //NoLogo .\ip.vbs >> .\inventory.txt
Output of inventory.txt
Microsoft Windows XP Home Edition 5.1.2600
144.136.24.160
What I would like to do is have this:
<computername1>,,,,,,,, Microsoft Windows XP Home Edition 5.1.2600,
144.136.24.160, etc
<computername1>,,,,,,,, Microsoft Windows XP Home Edition 5.1.2600,
144.136.24.160, etc
<computername1>,,,,,,,, Microsoft Windows XP Home Edition 5.1.2600,
144.136.24.160, etc
<computername1>,,,,,,,, Microsoft Windows XP Home Edition 5.1.2600,
144.136.24.160, etc
Add a comma automatically at the end of each script that has run, and also
have the entries automatically inserted on the SAME LINE at the end of the
previously run script..
Why? - to import it into a spreadsheet.
Is there any way to do this guys?
Any help greatly appreciated.
Simon
--
---------------------------------------------------------------------
"Are you still wasting your time with spam?...
There is a solution!"
Protected by GIANT Company's Spam Inspector
The most powerful anti-spam software available.
http://mail.spaminspector.com Tag: MS Image Resizer Tag: 148662
Adding a delimiter at the end of lines automatically
Hi gurus, Im new to vbscript and would love your help.
I want to build up a text file with different inventory specs.
I run a batch file which runs 2 (so far) vbscripts - very simple stuff (as
follows).
inventory.bat
cscript //NoLogo .\os.vbs >> .\inventory.txt
cscript //NoLogo .\ip.vbs >> .\inventory.txt
Output of inventory.txt
Microsoft Windows XP Home Edition 5.1.2600
144.136.24.160
What I would like to do is have this:
Microsoft Windows XP Home Edition 5.1.2600,
144.136.24.160,
Add a comma automatically at the end of each line.
Why? - to import it into a spreadsheet.
Is there any way to do this guys?
Any help greatly appreciated.
Simon
--
---------------------------------------------------------------------
"Are you still wasting your time with spam?...
There is a solution!"
Protected by GIANT Company's Spam Inspector
The most powerful anti-spam software available.
http://mail.spaminspector.com Tag: MS Image Resizer Tag: 148661
scrollIntoView not bringing object to top of screen
The script below does what I'm looking for. It finds the first instance of
the current date on the active page, scrolls it into view, and selects it.
However, I'm trying to get the date to be scrolled to the top of the page.
From what I read on MSDN about scrollIntoView, this is supposed to be the
default behavior of the command. However, it only seems to work if the date
is found above what is currently showing on the screen. If the date is
found below whats currently on the screen then the scrollIntoView seems to
default to scrollIntoView(false) with no way to change it (meaning the
object being scrolled to is always at the bottom of the screen). Is there a
workaround that can force it to the top?
By the way, I'm using this to quickly scroll to new posts in a forum I
frequent.
Thanks!
-Jeremy
---------------------------------------------------------------------------
<script language="vbscript">
Dim sDate, oRange
sDate = Right("0" & Day(Date),2) & "-" & Right("0" & Month(Date),2) _
& "-" & Year(Date)
Set oRange = document.body.createTextRange
With oRange
.findText(sDate)
.scrollIntoView(true)
.select
End With
</script>
--------------------------------------------------------------------------- Tag: MS Image Resizer Tag: 148655
How would you parse the nubers out of this text?
I need to parse out the first number to the immediate left of the
first letter in each of the words. For example, the output would be
2,3,3,3,3
2GreysIceStorm 1093Pnj'sPromenade 31.053Pnj'sPromenade
3Pnj'sPromenade 3Pnj'sPromenade
In this line of text:
4Bob'sHammer 1008Leta'sCharlotte 31.166MaryvilleShep
5Keyless 2GreysIceStorm
The output would be 4,8,6,5,2
Is this possible with vbscript. Is there a way to make a script look
for the first number to the immediate left of any letter? Tag: MS Image Resizer Tag: 148639
VBScript.Encode Trouble
When using screnc.exe to encode ASP files, the resulting encoded ASP file
produces the following error:
Microsoft VBScript compilation error '800a03ea'
Syntax error
?, line 0
The ASP page is being served on the same server it was encoded on:
Window 2000 Server SP4
VBScript 5.6.8515
Any ideas? Thanks.
-joshua Tag: MS Image Resizer Tag: 148629
WScript.Shell works as .vbs file, doesn't work as .htm file
When I double-click on the following file saved
as "c:\test.vbs" it works:
Dim wsh
Set wsh = WScript.CreateObject("WScript.Shell")
Wsh.Run("C:\testfile.exe")
When I double-click on the following file saved
as "c:\test.htm", I get RunTime Error "Line 4 Error:
Object required: 'WScript'". Except for the HTML and
SCRIPT lines, the files are identical (I copied and
pasted the code from one to the other).
<HTML>
<SCRIPT LANGUAGE="vbscript" defer>
Dim wsh
Set wsh = WScript.CreateObject("WScript.Shell")
Wsh.Run("C:\testfile.exe")
</SCRIPT>
</HTML>
Why does it work as a .vbs file and not a .htm file?
Thanks in advance. Tag: MS Image Resizer Tag: 148628
Hex to String???
I've been browsing and I can't seem to find a good way in
vbs to convert a hex to a string. I see a hex() function
that takes a string but I don't see a toString() that
takes a hex vaule.
Can anybody point me to a usefull resource? I'd be more
than happy to work with a conversion table...
thanks, and you guys are great!
-Jess Tag: MS Image Resizer Tag: 148612
? VBS File Browse Dialog
Hi,
I need a way of browsing for a file (eg: Common Dialog) in a VBS file.
How can I do it?
Thanks a lot.
--
Alec
asoroudi@synetech.cjb.net
Ò Tag: MS Image Resizer Tag: 148608
CDONTS not sending from invalid email address
Will CDONTS not send emails from an invalid email address? For instance, I
have this code:
?------------------------------------
Set objCDONTS = Server.CreateObject("CDONTS.NewMail")
objCDONTS.From = "blahblahblah@invalidEmailAddress.com"
objCDONTS.To = "myEmailAddress@myDomain.com"
objCDONTS.Subject = "My Subject"
objCDONTS.Body = "Test"
objCDONTS.Send
?------------------------------------
If I know that the 'from address' is not valid, the email will not send.
The routine will complete without a problem, but I will never receive an
email. Why is that? How does CDONTS know if the email address is valid or
not?
The reason I ask is that I get the 'from email address' from a web form, and
the users sometimes (accidentally) give an invalid email address. I still
want the email to send, however. I would like to send it from this persons'
email address (as they entered it).
Can anyone lend a hand? Tag: MS Image Resizer Tag: 148606
Scroll to specified text in current web page (Client-side)
I'm trying to create a vbscript that will find the current date on the
active web page in IE and then scroll to that location in the page.
All I have so far is the date in the format I'm looking for.
------------------------------------------------------------------
<script language="vbscript">
Dim sDate
sDate = Year(Now) & "-" & Right("0" & Month(Now),2) & "-" & Right("0" &
Day(Now),2)
msgbox sDate
</script>
------------------------------------------------------------------
I was looking into the FindText method on MSDN http://tinyurl.com/x8sn, but
as I'm a rookie in regards to VBScript. I don't even know if I'm barking up
the right tree.
Any help would be great. Thanks!
-Jeremy Tag: MS Image Resizer Tag: 148605
Change BIOS passwords with VBscript
Hi,
I need a script through which i can change the bios passwords for
all/any of the machines in a network/domain.
Thanks for any kind of help.
Gaurav Tag: MS Image Resizer Tag: 148598
wscript vs cscript problems
When I run a script I developed with cscript.ext it runs fine, when I run it
with wscript.exe I get the error:
Script: c:\myscript.vbs
Line:124
Char: 2
Error:The hande is invalid
Code: 80070006
Source: (null)
Here is the portion of code that is relavent: What's the difference between
wscript and cscript?
'User Information
Dim strCompName
Dim strUserName
Dim strDomainName
'Main-----------------------
GetUserInfo
'---------------------------
Sub GetUserInfo
Dim ws
Set ws = WScript.CreateObject("WScript.Network")
strCompName = ws.ComputerName <---error here with wscript.exe
strUserName = ws.UserName
strDomainName = ws.UserDomain
End Sub Tag: MS Image Resizer Tag: 148597
Add a label to Computer Properties General tab?
How can I add a label to the Computer Properties General tab?
(right click on "My Computer" and click "Properties.")
I want to put some information on there about the enterprise build of the PC
configuration.
Currently I am able to only change the Description field on the Computer
Name tab using the following snippet:
Set wscr=CreateObject("WScript.Shell")
Read the registry Value
sReg =
wscr.RegRead("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\lanmanser
ver\parameters\srvcomment")
msgbox sReg,,"Computer Description Information"
Thanks in advance!
David Johnson Tag: MS Image Resizer Tag: 148595
Problem with sending command to a service
Hi!
I have a problem with sending commands to my service - it simply doesn't
answer...
I used similar code in VB.NET and it responded so service is OK
As well the way of finding service is also right because when I used
StartService method it was started...
I use UserCustomCommand method but instead of 0 (everything is right) it
returns 21(Status Invalid Parameter) and simply I have no idea why...
Please help...
That's the code:
Option Explicit
Dim objWMIService
Dim objSerwisList
Dim objItem
Dim objItema
Dim strserwis
Dim iCommand
Dim return
iCommand = 200
strService = "test"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" + "." + "\root\cimv2")
Set objSerwisList = objWMIService.ExecQuery("Select * from
Win32_Service where Name = '" + strService + "'")
For Each objItem In objSerwisList
return = objItem.UserControlService(iCommand)
MsgBox(return) 'shows "21"
Next Tag: MS Image Resizer Tag: 148579
string formatting fixed digits
Hello,
I am trying to define or format a variable to a 3 digit
nummeric value. The wanted result sould be like: strNumer
+ 1 = 001, strNumer + 32 = 033 etc. I have tried the
FormatNumer function but this doesn't give the wanted
outcome. Can anybody help me with this?
Thank you for your help... Tag: MS Image Resizer Tag: 148572
Recurse all files and subfolders of a root folder? Not just the top level
Is it possible to find out the number of files and folders a supplied
folder has?
You know like when go into the properties of a folder it says the
size, number of files and folders in the entire folder (not just the
first level)
As far as I can tell there is not way to get the properties "contains
X files, X folders" Tag: MS Image Resizer Tag: 148563
How to sink events with the Scripting Control
If I add an object to the MS Scripting Control using the AddObject method
how can I let the script sink events raised by this object?
/J Tag: MS Image Resizer Tag: 148560
Zipping a text file
I need to compress a text file, dump of database data as SQL statement, for
backup purposes. I know that Windows XP has a built in ZIP application, can
i use this application to zip these dump files, or will i need to use
another application.
Your help is appreciated.
Regards
--
Justin Fowler
Programmer
MizziSoft P/L
Ph: +61 3 9645 7111
Fax: +61 3 9645 7533
http://www.mizzisoft.com
_________________________________________________
This email is subject to professional privilege. If you have received
it in error, any disclosure, copying or use of the contents of this
email is prohibited. If you have received this email in error please
reply to the sender or telephone the sender on +61 3 9645 7111 or fax on
+61 3 9645 7533. Tag: MS Image Resizer Tag: 148557
Get workgroup/domain name from 32 bit Windows
Hi there,
I need to be able to get the workgroup or domain name
(depending on config of machine) of all our machines
running 32 bit versions of Windows... I know how to get
this info with Win9x up to ME but have had no luck
finding this info in the registry of 32 bit versions.
Anyone got any suggestions? This will need to cover NT4
up to XP....
Any help appreciated...
Cheers Tag: MS Image Resizer Tag: 148553
Find the Favorites foler size of each user. Number of files and subfolders.
Hi
I've created a script but now I am stuck. Note: I realize that I
have to clean up the code into functions and such. I just want to get
things working first before I clean it up.
The problem I am trying to get an answer to the following:
How do I get all of the number of files and folders of the Favorites
folder.
I'll be moving this from the local PC and getting it to work on a
folder of a server later.
My current code....
'================================================================================================
'|Description:
'|
'| Returns the Profile folders sizes and Favorites folder sizes to a
file - C:\Profile Sizes.txt
'================================================================================================
' Create the File System Object
Set FileSys = CreateObject("Scripting.FileSystemObject")
' Create the text file - Profile Sizes.txt
Set TextFile = FileSys.CreateTextFile("C:\Profile Sizes.txt")
WScript.Sleep(1000)
'Set the folder to get subfolders from...
Set Folder = FileSys.GetFolder("C:\Documents and Settings")
'Get the Subfolder Collection
Set SubFolders = Folder.SubFolders
' Write the Info to a file
TextFile.Write "Folder Size Report " & Now & vbCrLf
TextFile.Write "========================================" & vbCrLf &
vbCrLf
For Each Folder1 in SubFolders
strLine = Folder1.Name & ", Profile=" &
FormatNumber((Folder1.Size/1048576),2) & " MB, "
' Write the Folder Name to a file
TextFile.Write StrLine
'==================================================
' Find out the size of the user's favorites folder in KB
Set UserSubFolders = FileSys.GetFolder(Folder1)
'Get the Subfolder Collection
Set UserFolder = UserSubFolders.SubFolders
' Inside Loop
For Each UserSub in UserFolder
If UserSub.Name = "Favorites" Then
strLine = UserSub.Name & "=" &
FormatNumber((UserSub.Size/1024),2) & " KB"
' Write the Folder Name to a file
TextFile.Write StrLine & vbCrLf
End If
Next
'=================================================
Next
' Close the Text File
TextFile.close
WScript.Echo ("The C:\Folder Sizes.txt Report is Complete!")
OUTPUT
=======
Folder Size Report 11/30/2003 2:12:07 PM
========================================
All Users, Profile=187.48 MB, Favorites=0.00 KB
Default User, Profile=0.34 MB, Favorites=0.00 KB
Jim, Profile=888.97 MB, Favorites=78.83 KB
Joy, Profile=312.24 MB, Favorites=9.41 KB
LocalService, Profile=1.87 MB, Favorites=0.12 KB
NetworkService, Profile=0.48 MB, Tag: MS Image Resizer Tag: 148548
Read News from an NNTP Server
Hi !
Is possibile via VBscript access an NNTP server to read news whitout install
dedicated components ??
Tanks in advance Tag: MS Image Resizer Tag: 148546
CopyHere VBScript method working on Windows 2000, but not on XP...
Hello,
I am trying to copy the contents of one folder to another using the
following VBScript code:
set SA = CreateObject("Shell.Application")
set FolderObj = SA.NameSpace("C:\temp")
FolderObj.CopyHere "C:\HLCache\*.*" , 16+512
The thing is, in Windows 2000, this code works fine, the progress dialog
appears and copies the files in the right place. I am running WSH 5.6 on
that system. But in Windows XP, I receive this error message:
C:\DOCUME~1\Robert\LOCALS~1\Temp\~shlcpy.vbs(3, 1) Microsoft VBScript
runtime er
ror: Object required: 'FolderObj'
I am also running WSH 5.6 on Windows XP. The same message appears for other
Windows XP machines I have too. I need to use the CopyHere method as this is
the only way I can have a progress indicator. But why would it work on
Windows 2000 and not in XP?
Please can someone help me!
Robert Tag: MS Image Resizer Tag: 148545
Format string as hyperlink
The following outputs from an access database. Its simply a string
representing a hyperlink. When it is displayed I want it to display as a
hyperlink and open in a new window:
<td><%=(rsLinks.Fields.Item("url").Value%></td>
what is the correct format for doing this?
John Kostenbader Tag: MS Image Resizer Tag: 148537
Changing IE-settings
Hi,
is it possible to change the security options of Internet Explorer by a
VBScript?
I usually run the IE with security level set to high in the Internet Zone
but some sites require medium level. My preferred solution would be to make
the change via a button within the IE itself.
Any ideas?
Ingo Tag: MS Image Resizer Tag: 148536
Script date
Hi all,
I tried an example script vbs that it changes the short date to extended
date, example 30/11/2003 to Sun 23 November 2003.
Thanks Tag: MS Image Resizer Tag: 148527
Convert numerics into date & time
These are coming from a w2k box, how do I conver to a valid date.
InstallDate: 20020911065353.000000+600
LastBootUpTime: 20031130004708.000000+660
LocalDateTime: 20031130185325.627000+660
Don Tag: MS Image Resizer Tag: 148524
inter-job invocations with CreateComponent and CreateScriptlet
I seem to remember some lengthy discussions of the fact that you cannot call
another job within a particular script.
It turns out that this is not quite the case. CreateScriptlet and
CreateComponent both seem to work fine with this, although the jobs appear
to be compartmentalized - I can't share variables between them, for example.
However, if you need to perform some truly generic tasks, you can invoke
another job with this. The one object which DOES seem to be shared between
jobs is WScript, so you can do argument-based processing. Also, one
oddity - for some reason, the VarType of CreateComponent's return value is
13, which is a vbDataObject...
<?xml version="1.0" encoding="ISO-8859-1" ?>
<package>
<job id="job1">
<runtime>
<description><![CDATA[ ]]></description>
<example><![CDATA[ ]]></example>
<named name="?" helpstring="returns this help message" type="simple"
required="false"/>
</runtime>
<script language="VBScript"><![CDATA[
' arg1
wscript.echo "entering job1"
set t = CreateScriptlet("job2")
wscript.echo "typename of t:", typename(t)
wscript.echo "vartype of t:", vartype(t)
' the lines below will all throw errors, unfortunately
' t.hello
' set t = CreateScriptlet("job2").hello
wscript.echo s ' <--- shows nothing - variable scoping works fine...
wscript.echo "leaving job1"
]]></script>
</job>
<job id="job2">
<script language="VBScript">
<![CDATA[
wscript.echo "in job 2"
for each arg in WScript.Arguments
WScript.Echo arg
next
dim s: s = 3
public sub hello
WScript.Echo "Hello from job2's sub hello()"
End sub
]]>
</script>
</job>
</package> Tag: MS Image Resizer Tag: 148523
Windows 2003 Scripting Guide
Any update on the progress or availability of the Windows 2003 Scripting
Guide from the MS Scripting Guide? TechNet Script Center mentions a late
2003 availability but I can't find any other updates...
Thanks,
--
Shawn P Bolan
sbolan@yahoo.com Tag: MS Image Resizer Tag: 148521
ASP Encoding
Dear Members,
I am running the Script Encoder on this "ine2c.asp" file,
however I gets this message no matter what I do to this
file, I even took out most of the html tags.
Why the Script Encoder Object failed to encoded asp file,
but it works fine on .js files.
Here is the message I gets:
Microsoft(R) Windows 98
(C)Copyright Microsoft Corp 1981-1999.
C:\Encoded Script>screnc *.asp c:\temp
Scripting encoder object ("Scripting.Encoder") failed on
C:\Encoded Script\ine2c.asp
C:\Encoded Script>
Thank you,
Eli Tag: MS Image Resizer Tag: 148519
cdo version
is it possible to check what version is on a server.
I have a page that runs on my machine which nips off to the exchange server,
interrogates a dist list to get the calendar details for all the members
(then shown in a table). However when I run it from the dev server it
returns nothing. Outlook is installed on the dev server as is on my PC.
Wondering if it may be the version of mapi/cdo (shrugs) on the dev machine?
Windows 2000 and outlook 2000 on both.
Jay
---
Yo! outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003 Tag: MS Image Resizer Tag: 148518
How i can to run a link of program with VBscript?
I would want put this script in GPO so all PC in the domain they are running
with this program
Excuse for my english
Someone help me please?
bye thanks Tag: MS Image Resizer Tag: 148515
Constructors for VBScript classes - naming ideas?
Although VBScript doesn't support constructors, it's pretty straightforward
to mimic them with a simple function wrapper around a class creation call.
This method has been talked about before a few times; it would look
something like the code shown at bottom.
What I'm wondering about is good naming schemes for the external constructor
function (function new_Wheels in the example) and for the internal method
which it calls (sub init in the example).
I'm looking for a pattern which is immediately evocative, easy to type, and
likely to keep namespace pollution to a minimum.
An immediate scheme which comes to mind is to use my standby [] chars for
specially mangled names and then just use "New" and an
unlikely-to-be-made-randomly initial '_' for the constructor function. Then
for class Wheels the constructor would be [_Wheels], and the internal New
function could be called as
[_Wheels].New(...)
Those may not seem obvious or easy to other people. Any alternative schemes
that make sense?
===============
Silly Class-With-Constructor-Function Example
set myCar = new_Wheels("metallic aqua", "Prefect", "Ford", "car")
function new_Wheels(color, model, make, cat)
set new_Wheels = New Wheels: new_Wheels.init color, model, make, cat
end function
class Wheels
public color, model, make, category
public sub init( clr, mdl, mk, cat)
if VarType(clr) = vbError then color = "rust" else color = clr
if VarType(mdl) = vbError then model = "128" else model = mdl
if VarType(mk) = vbError then make = "Fiat" else make = mk
if Len(cat) = 0 then category = "car" else category = cat
end sub
end class Tag: MS Image Resizer Tag: 148507
Set wallpaper with a VBS script
I'm a newbie, more like a "nobie" to VBS script... Couldn't find a way to
change wallpaper in Group Policy without using active desktop so I'm trying
a VBS method.
What am I doing wrong? The change in the registry is accomplished but no
change in the wallpaper is seen.
------------------------------------------
Set WshShell = WScript.CreateObject("Wscript.Shell")
WshShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper",
"C:\WINNT\FeatherTexture.bmp"
WshShell.RegWrite "HKCU\Software\Microsoft\Internet
Explorer\Desktop\General\BackUpWallpaper", "C:\WINNT\FeatherTexture.bmp"
WshShell.RegWrite "HKCU\Software\Microsoft\Internet
Explorer\Desktop\General\Wallpaper", "C:\WINNT\FeatherTexture.bmp"
---------------------------------------------------------
This is on win2kpro no active desktop. After a restart the wallpaper change
is applied but I want it to apply immediately.
Dave Niemeyer Tag: MS Image Resizer Tag: 148501
FSO or ADODB?
Without referencing documented articles, what is your preference and why
would you use FSO, including XL vs ADODB to retrieve dynamic content? I
have read numerous articles that state a db is unnecessary overhead and/or
FSO is more complicated and requires extra programming for the same result.
Where have you found one vs the other to be beneficial and please provide
the particulars.
--
Roland
This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. Tag: MS Image Resizer Tag: 148500
Script
I need to created a login script that will at login search for a specific
file and delete it from the computer, not matter where it is located.
Thanks
Arnold Tag: MS Image Resizer Tag: 148487
Script Encoder
Dear Members,
I am running the Script Encoder on this "ine2c.asp" file,
however I gets this message no matter what I do to this
file, I even took out most of the html tags.
Why the Script Encoder Object failed to encoded asp file,
but it works fine on .js files.
Here is the message I gets:
Microsoft(R) Windows 98
(C)Copyright Microsoft Corp 1981-1999.
C:\Encoded Script>screnc *.asp c:\temp
Scripting encoder object ("Scripting.Encoder") failed on
C:\Encoded Script\ine2c.asp
C:\Encoded Script>
Thank you,
Eli Tag: MS Image Resizer Tag: 148478
I would like to implement a VBScript to use the Image
Resizer from the XP Powertoys. Does anyone know if this
is possible and if so what object I need to link to?
>-----Original Message-----
>I would like to implement a VBScript to use the Image
>Resizer from the XP Powertoys. Does anyone know if this
>is possible and if so what object I need to link to?
>.
>
I use ImageMagick, which is a COM+ component which can be
easily called by VBS.