Problem with variable scope
Hello all,
I have the following script:
Test = "hello"
If Test = "hello" then
MyVar = "ok"
end if
MsgBox MyVar
I would expect that variable MyVar would hold "ok" but it does not.
Is the scope of this variable limited to the if - end if construct ?
How can I workaround this ?
Thanks
Bar Tag: Defrag Report Tag: 165212
Messagebox which is only 3 seconds active
Hi
Is there a possibility to show a messagebox only for seconds? I just want to
give some infos to the user and let the box automaticly remove an continuing
the code?
I think it is not a msgbox but is there a way?
Thanks for every help!
Nijazi Halimaji Tag: Defrag Report Tag: 165210
How to create a simple web service and consume it from VB Script
Hello All
Can you kindly share how to create a simple web service in VB Script
if not possible in VB Script please provide a simple sample in VB and
how to compile it and then how to consume this web service form VB
Script.
Thanks
Karen Tag: Defrag Report Tag: 165207
Accepting user input with WSH
Hi,
What I am going to do is write some scripts to generate a file with a
the text of all files in a certain directory. I will then create another
script to seach that created file and output the search results to a
.html page for viewing. My problem is not generating the file with the
text, or doing the searching or generating the results but after
searching all the docs I can find on MSDN, there doesn't seem to be a
way for my to create a way other than on the command line to accept user
input for the search parameters.
Any suggestions or URLs would be great.
Ideally I would like to popup a small dialog box to accept the users
input.
One caveat though I may only use scripts, no compiled executables are
allowed.
Thanks for the assistance
Jack Wayne Tag: Defrag Report Tag: 165198
How to do something based on set of workstations
I want to do something based on the workstation that runs the script. I.E.
if is a workstation FRED or BARNEY or WILMA, or BAMBAM I want it to do x,
and if it is BART or HORMER or LISA I want it to do y and so on. I could
write a ton of if statements but that seems inefficient, is there another
way?
Thanks,
Arch Tag: Defrag Report Tag: 165187
Newbie question about instantiating objects
If I want a script to bind to a folder "A", I understand that I need to
first instantiate the folder object
[e.g., Set fso = CreateObject("Scripting.FileSystemObject")],
' = Line #1
and then assign an object reference moniker to the folder object
[e.g., Set files = fso.GetFolder("C:\A").Files].
' = Line #2
Well, this raises a few questions for which I haven't been able to find
answers..
a. Must Line #2 come immediately after Line #1?
b. If I want to work on folder "B" too in this script:
1) Do I repeat Line #1 again as follows?
Set fso = CreateObject("Scripting.FileSystemObject")
' = Line #1 again
Set files = fso.GetFolder("C:\B").Files.
' = Line #3)
2) If I do repeat Line #1 again, how do I tell a routine which
folder object to work on?
3) Where can I find the answers/explanations for these questions?
Thanks,
marc hankin Tag: Defrag Report Tag: 165183
Using GPG From Script
Hello,
Yes, I've Googled and so on, but am a bit stuck. This is actually my
first vbscript. The goal is to manage GPG encryption/decryption of
files from a script, which will eventually be a function of a larger
script. The script below is my attempt at getting this working. The
first WshShell.Exec works but the second does not (the first one may
wrap). I'm sure it's something simple.
---
Option Explicit
'Declare the variables
Dim WshShell, oExec
Dim GPGPTFName
Dim GPGRecip
'Define the variables
GPGPTFName = "c:\gnupg\test.txt" 'GPG plain-text filename
GPGRecip = "someone@somedomain.com" 'GPG recipient
'Define the constants
Const GPGEncrypt = "C:\gnupg\gpg.exe -e -r" 'GPG command to encrypt
Const GPGDecrypt = "C:\gnupg\gpg.exe -d" 'GPG command to decrypt
'Invoke the WScript Shell Object
Set WshShell = WScript.CreateObject ("WScript.Shell")
WshShell.Exec "C:\gnupg\gpg.exe -e -r someone@somedomain.com
c:\gnupg\test.txt"
WshShell.Exec (GPGEncrypt & GPGRecip & GPGPTFName)
---
Also, please bear in mind that I will eventually need to capture an exit
status and error out to a mail function (with the reason why it failed),
if it fails. All help appreciated. Tag: Defrag Report Tag: 165180
Wireless WMI class
Hello to all,
I´m Eduardo Martin(Spain). In first place, thanks to Ulf Dornheck Busscher
to reply me last question about configure several ip address.
I return with a new question. I´m developing a script to work with wireless
network. But i cannot find a WMI class to configure the SSID(Network name)
for a wireless network device. i have been searching in WMI class library,
command-line help, netsh command,etc...
Can anyone help me with this problem? Tag: Defrag Report Tag: 165177
How can i refresh the desktop ?
i wrote a script to set the wallpaper
how can i refresh the desktop after i run the script ?
i found on the web that i can run "RunDLL32.EXE USER.DLL,repaintscreen" to
do that
but this is not supported in winxp
thank you.
gary Tag: Defrag Report Tag: 165174
Can vbscript name files in a web folder?
I'm wondering if I should learn vbScript...
I'd like to have a folder in my webspace, where I can dump any number
of jpg's arbitrarily, and write a web-page that will pick up
everything in the jpg folder, without my having to name each jpg in
the script.
Can that be done with vbscript, or does it exceed security limitation.
tony Tag: Defrag Report Tag: 165170
MsgBox return Values --- help please
I have this code block setup within my ASP page using VB Script as the main
language.
I want to be able to return the value of the client side VBScript back to
the main page for processing.
Does anyone know how to achieve this?
Thanks!
######
CODE
######
if entryExists > 0 then
%>
<SCRIPT LANGUAGE="VBScript">
MsgVal = MsgBox ("Date Already Exists!", 1, " PLEASE NOTE !!")
</SCRIPT>
<%
if MsgVal = 1 then
Response.Write "OK PRESSED"
else
Response.Write "CANCEL PRESSED"
end if
end if Tag: Defrag Report Tag: 165168
From numbers to letters.
This script transforms a number in words.
It works fine but as I'm a non-native english speaker I don't know if the result is
correct english.
Especially for Billions. A few years ago some english and american friends of mine could
not agree on the value. In the scirpt are thousands of millions.
Hope a reader from Florida of this ng will appreciate. ;-)
I will not say his Name.
Bye.
Giovanni Cenati.
'************************************************
' File: From numbers to letters_test.vbs
' Author: Giovanni Cenati
' my address is at katamail dot com with name Reventlov
'************************************************
'SET FSO = CreateObject("Scripting.FileSystemObject")
'SET TextFile = FSO.CreateTextFile("test.txt", True)
'for i=23400000 to 23401700 step 17
'TextFile.Write i & " " & Trasformainlettere(i)
'TextFile.WriteLine
'next
'msgbox "end test"
A=inputbox("Number to be converted in letters:")
a=inputbox("Converted:",,Trasformainlettere(a))
wscript.quit
'-------------------------------------------------------
'************************************************
' File: Transforms to letters.vbs (function)
' Author: Giovanni Cenati
'
'************************************************
function TrasformaInLettere(byval n)
dim i, dec, lun, lett
dim tri(5)
n=cdbl(n)
num=cstr(fix(n))
Str=cstr("000000000000000000000"&num)
lun=len(Str)
for i=1 to 5
'cuts the string in pieces
tri(i)=mid(Str,lun-(i*3)+1,3)
'The number is now tri(5)& tri(4)& tri(3)& tri(2)& tri(1).
if tri(i)>0 then lett= TrasformaTerzina(tri(i),i) & lett
next
if lett="" then lett="zero" 'manages the zero
TrasformaInLettere= lett
end function
function TrasformaTerzina(tri,t)
'tri is "nnn" to be converted.
't is the number as below::
't=1 if the number is from 1 to 999
't=2 from 1000 to 999000, e.g. the thousands
't=3 are the millions, etc
dim ultimeduecifre,ris,decine,unita
dim n(30) 'all the figures in letters
n(0)=""
n(1)="one":n(2)="two":n(3)="three":n(4)="four":n(5)="five"
n(6)="six":n(7)="seven":n(8)="eight":n(9)="nine":n(10)="ten"
n(11)="eleven":n(12)="twelve":n(13)="thirteen":n(14)="fourteen":n(15)="fifteen"
n(16)="sixteen":n(17)="seventeen":n(18)="eighteeni":n(19)="nineteen"
n(22)="twenty":n(23)="thirty":n(24)="forty":n(25)="fifty"
n(26)="sixty":n(27)="seventy":n(28)="eighty":n(29)="ninety"
'manages the hundreds
if left(tri,1)>0 then ris=n(cint(left(tri,1)))&"hundred"
'if it is nxx then uses n+hundred
'manages numbers from 1 to 19 and from 20 on
Ultimeduecifre=cint(right(tri,2))
if Ultimeduecifre < 20 then
ris=ris&n(Ultimeduecifre) 'from 1 to 19 uses the array "n".
else
'manages separately tens and units from 20 then joins them
Decine=mid(tri,2,1) 'tens
Unita=right(tri,1) 'units
ris=ris & n(20+decine) 'from n(22) is twenty, n(23) is thirty,etc.
Ris=ris & n(Unita) 'adds one, two three...
end if
'manages the position of thousands, millions, etc.
if t=2 then
ris=ris&"thousand"
if tri=1 then ris="onethousand"
end if
if t=3 then
ris=ris&"millions"
if tri=1 then ris="onemillion"
end if
if t=4 then
ris=ris&"billions"
if tri=1 then ris="onebillion"
end if
if t=5 then
ris=ris&"thousandbillions"
if tri=1 then ris="onethoudandbillions"
end if
TrasformaTerzina=Ris
end function
'-------------------------------------------------------
--
Giovanni Cenati (Aosta, Italy)
Write to user "Reventlov" and domain at katamail com Tag: Defrag Report Tag: 165166
Createing active directory users from non administrator accounts.
I work for a public school district. I have a script that will add users to
Active Directory from a .CSV file. My problem is that I don't get
notification of new hires and new students. I also don't get notification
of students or employee's that leave. What I would like to do is have human
resourses a script that will add new accounts for the new employee's and
also an office script for new students. How can I have my script
authenticate as an administrator so that it will create the accounts? Thank
you Tag: Defrag Report Tag: 165157
create loop through three recipients email addresses
With iMsg
Set .Configuration = iConf
.To = sRecipients
.From = sFrom
.Sender = sSender
.Bcc = sBcc
.Subject = sSL
.HTMLBody = strHTML
Next
End If
.Send
End With
-----------------
How do I create loop through three recipients email addresses, one at a
time? Tag: Defrag Report Tag: 165143
how to cactch activex event in html page
Hi,
I'm developing an activex in C++. I'm using it in HTML pages. I
managed to call proporties and functions of this one. But I can't
catch his events.
I try it in VB and test container, and it's working very well. I've
tried following code :
<SCRIPT LANGUAGE="javascript" FOR="TelephonyPayment"
EVENT="NetworkReachedEvent()">
alert ("usercontrol event fired");
</SCRIPT>
<SCRIPT LANGUAGE="VBScript">
Sub TelephonyPayment_NetworkReachedEvent()
msgbox "Event Fired"
End Sub
</SCRIPT>
<script language="JScript">
function TelephonyPayment::NetworkReachedEvent() {
alert('Event fired: ');
}
</script>
But nothing runs.
What's the problem ?
Thanks in advance for your help Tag: Defrag Report Tag: 165142
If sExt = "jpg" or "jpeg"
is it possible for this piece of code to be amended to include more than one
type of file extension?
If sExt = "jpg" or "jpeg"
doesn't seem to work.
sExt = oFSO.GetExtensionName(oFile)
If sExt = "jpg" Tag: Defrag Report Tag: 165138
vbs to issue command
Hi,
How can I get vbs to issue this command:
sfc /scanonce
--
Regards,
David
Windows XP home edition Tag: Defrag Report Tag: 165133
Several IP addresses script
Hello friends,
i´m Eduardo Martin(Spain).
I´m developing a script to put several ip addresses to a network device.
Using as template the scipt to put a ip address of technet script repository
i´m able to put only one ip, and i have tryed to find in WMI library, play
with arrays, etc... without results.
Can anyone help me , or give me a clue ??
Thanks in advanced Tag: Defrag Report Tag: 165132
refresh screen while vbscript is running
Hi all,
I'm writing an HTML-page with a script that changes the view of the page.
It works fine, but the changes will only show after the script stops.
I want to see the changes as they are made (with a delay-loop to follow the
progres)
How can I do that?
Thanks,
Jan Hendrickx. Tag: Defrag Report Tag: 165126
Using vbs to set power settings
Hi all
I'm in the middle of a migration and a tedious task of configuring
settings within the users profile i would like to get to grips with
vbs and my first task which i could use as a stepping stone is to set
the user power settings
using search i have found that the following script can be run within
a cmd line
powercfg /change normal /monitor-timeout-ac 10
how could i set this using vbs
also within power script when user closes laptop "to do nothing"
couldnt find anything within powercfg /? that would help
thanks in advance Tag: Defrag Report Tag: 165124
Adding users to groups in AD
I have the code from the TechNet Script center for adding users to groups
which works great. But what do you do if you do not know the OU the user is
in. Is there a way to search AD and return the value so that it can be
passed to the code which will be adding the users to the group. I am
interested in on creating a utility to add members to a group by providing a
list of users in a text file.
Paul Glickenhaus Tag: Defrag Report Tag: 165123
Scheduling a VBS within a at job
Hi all,
I have created a bat file to schedule automatically a vbs as follow:
at 01:00 /every:M,T,W,Th,F,S,Su cmd /c "c:\bat\check.vbs"
at 02:00 /every:M,T,W,Th,F,S,Su cmd /c "c:\bat\check.vbs"
at 03:00 /every:M,T,W,Th,F,S,Su cmd /c "c:\bat\check.vbs"
...
I works, but when a cmd.exe and wscript.exe keep running within Task Manager...
What is the best way to schedule within a batch?
Any help/suggestion is highly appreciated.
Thanks in advance for your help,
Kind Regards,
Rui Vilao. Tag: Defrag Report Tag: 165122
Null return to registry query
Problem: Connection to the registry returns null value
Platform: Windows XP, SP1
Users: Runs as logon script under normal user credentials.
The line of code that returns the null value is:
Set oReg=GetObject("winmgmts:root\default:StdRegProv")
To note is that the script works on some configurations and not
others. I assumed the problem was security related and replaced the
code with:
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\root\default:StdRegProv")
to no avail. I have noticed the security log consistently logs event
577, privilege use failure audit indicating "Privileges:
SeIncreaseBasePriorityPrivilege". This may or may not be related. I
was wondering if anyone else had seen similar behavior in especially
locked down environments. Thanks. Tag: Defrag Report Tag: 165119
Event log monitoring
I have a script written to monitor logs and send out an SMTP mail message to
me.
Problem is - If a server has a problem on the SAME event (i.e. Symantec
Errors) I only want it to send me the message 1 time
Here is what I have thought of to fix it:
Every time an event occurs - it appends to a txt file the event id code.
Everytime it finds an error - it first checks that file to see if that event
id is in there. if it is, it skips it.
I will delete this file 1 time a day with another script to stop it from
running.
My question:
How do I code it to append something to a txt file - I know that is an easy
one
Next, how do I check it, or read it to say if its found, then skip it. else
send out the mail
Thanks in advance Tag: Defrag Report Tag: 165118
100% CPU script
Hi,
This following script executes a traceroute to 213.13.135.13 every ~30
seconds.
--------------------------------------------------
option explicit
dim so
dim st
st = timer()
while true
if (timer() - st) >= 30 then
set so = createobject("wscript.shell")
so.run "cmd /c tracert 213.13.135.13"
set so = nothing
st = timer()
end if
wend
--------------------------------------------------
... the problem is that the "while true" loop consumes 100% of CPU.
Is there a better way of doing this? Something like a "sleep" method?
Thanks,
rusga Tag: Defrag Report Tag: 165115
User Account
hi,
could any one show me the vb script coding that can enumerate the user
accounts that set to 'Password Never Expired'. Thanks.
Fam Tag: Defrag Report Tag: 165113
script works in win2000 but not in win2003
I have an ASP script that calls a VBSCRIPT and it works fine in Windows 2000
but not on my new Windows 2003 server. Both servers are version 5.6 scripting
The error in IE is "Automation server can't create object"
Some of the code in my ASP file....
var shell = new ActiveXObject("WScript.shell")
shell.run("wscript \\\\sub.domain.com\script.vbs" .....etc Tag: Defrag Report Tag: 165112
who started script?
How can you tell if a script (vbs) was started by a user or by scheduled
task and no user logged on? If a user starts it someway I want to write to a
message box. If no one is logged on and task scheduler started it I want to
write to a log file.
thanks
ljb Tag: Defrag Report Tag: 165109
WBEM_FLAG_USE_AMENDED_QUALIFIERS
I have a bit of VB code I took from the Microsoft Technet Scripting resource
site as follows:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Security)}!\\" & _
strComputer & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery _
("Select * from Win32_NTEventLogFile")
For each objLogfile in colLogFiles
strLogFileName = objLogfile.Name
Set wmiSWbemObject = GetObject _
("winmgmts:{impersonationLevel=Impersonate}!\\.\root\cimv2:" _
& "Win32_NTEventlogFile.Name='" & strLogFileName & "'")
wmiSWbemObject.MaxFileSize = 2500000000
wmiSWbemObject.OverwriteOutdated = 14
wmiSWbemObject.Put_
Next
and found it errors upon running with the following error message, "an
amended object cannot be put unless WBEM_FLAG_USE_AMENDED_QUALIFIERS is
specified"..... how do I get around this? I've checked on the MSDN site fo
help but it all goes a little over my head!!!.
Please can any clever person help?
Philip Tag: Defrag Report Tag: 165103
what setting do I need to set the proxy in internet explorer
Hi,
I am have trouble following MSoft website. I want to right a script so I can
change the proxy setting to be on or off and then set the proxy to a server
and set the port. I have downloaded the script from the scripting guys. I can
list the information but can not find information on the msdn website to tell
me what I set the proxyserver to. can tell me or guide me where to look Tag: Defrag Report Tag: 165100
Calling server side Sub from link
Is it at all possible to call a Server Side VBScript Sub from a link? I've
got a link (an image) to download an application and when the user clicks the
image I want to call a Sub which will record the activity in a database. I
know that if it is possible it's not going to be straight forward! Any ideas
on how I can do it?
Thanks,
Carolyn Tag: Defrag Report Tag: 165098
VBScript: How to hide the mouse-Cursor
Hi
excuse me, probably a very simple thing, but I am new to VBScript:
During a Script-controlled presentation I'd like to hide the mouse cursor.
Which is the sacred command?
Thanks
Rupert Tag: Defrag Report Tag: 165096
Defrag Script Problem
I have downloaded the defrag.vbs script from MS Script Center. It defrags
the drive OK but doesn't close the application. Instead the script gets
stuck in a loop during:-
While WshShell.AppActivate("Defragmentation Complete") = FALSE
wscript.sleep 5000
Wend
At the end of the defrag a dialog box comes up but is not recognised by the
script:-
Disk Fragmenter
Defragmentation is complete for: (drive:)
Does anyone know how to sort this problem? I have tried changing
"Defragmentation Complete" but without success.
Also, I would like to defrag all drives before closing. Can I just use
sendkeys to move the focus in a loop to the next drive and repeat the process
once the problem above is sorted?
Thanks
Andrew
'This script launches defrag and sends keys to the UI in order to automate
the defrag
'process.
set WshShell = CreateObject("WScript.Shell")
'Launch Defrag from the command line and wait for a second
WshShell.Run "dfrg.msc"
WScript.Sleep 1000
'Wait until the application has loaded - Check every second
While WshShell.AppActivate("Disk Defragmenter") = FALSE
wscript.sleep 1000
Wend
'Bring the application to the foreground
WshShell.AppActivate "Disk Defragmenter"
WScript.Sleep 200
'Send an ALT-A key to bring down the degrag menu
WshShell.SendKeys "%A"
WScript.Sleep 200
'Send a D to start the defrag
WshShell.SendKeys "D"
'*****THE SCRIPT FAILS DURING THE NEXT BLOCK*****
'Wait until the defrag is completed - Check for window every 5 seconds
While WshShell.AppActivate("Defragmentation Complete") = FALSE
wscript.sleep 5000
'*****THE SCRIPT GETS STUCK IN A LOOP HERE*****
Wend
'*****THE SCRIPT DOESN'T GET TO HERE*****
'Bring the msgbox to the foreground
WshShell.AppActivate "Defragmentation Complete"
WScript.Sleep 200
'Send a tab key to move the focus from View Report button to the Close Button
WshShell.Sendkeys "{TAB}"
Wscript.Sleep 500
'Send key to Close the Defragmentation Complete window
WshShell.Sendkeys "{ENTER}"
Wscript.Sleep 500
'Send and ALT-F4 to Close the Defrag program
WshShell.Sendkeys "%{F4}" Tag: Defrag Report Tag: 165095
VBScript, ASP, and Active Directory
We are trying to use vbscript in a .asp page to authenicate a user in our
Active Directory.
The following works correctly against our main domain. Both the user name
and password is validated properly.
strADsPath=WinNT://domain.com
strUser =domain.com\j5c
Set oADsObject = oADsNamespace.OpenDSObject(strADsPath, strUser,
strPassword, 0)
Hereâ??s where the issue is, we have a separate domain for each site. Users
at each site are in the site domain
and not in the main domain. For example, the site domain is called
ada.domain.com on server ada-admin1. I have a user account
with j5c as the username in both the ada.domain.com and domain.com domains.
The following will find the j5c user but I can put anything in for the
password.
It finds j5c in the main domain, domain.com based on writing out the values
I put in the description field
on the j5c account in both domains. The return code is always 0 with a
correct user name and any password.
strADsPath =WinNT://ada.domain.com/ada-admin1
strUser =ada.domain.com\j5c
Set oADsObject = oADsNamespace.OpenDSObject(strADsPath, strUser,
strPassword, 0)
If I donâ??t include the server name, ada-admin1, in strADsPath
=WinNT://ada.domain.com/ada-admin1,
it does find the ada.domain.com domain.
Iâ??m not sure if the issue is the way we have Active Directory set up or the
syntax for pointing to the site domains. Tag: Defrag Report Tag: 165086
Regular Expression Validator
Does anyone here use the vb script regular expression validator ??
how do you grab text between "(" and ")" with it. Im used to perl
I've tried
/[(](.*?)[)]/
/((.*?)/)
to no avail... what am i doing wrong ?
i.e with text "(3) (4)" i would like to get "3" and "4" Tag: Defrag Report Tag: 165079
finding a URL in dynamically written html
I have a site that does a Response.Write() to create a table of
contents from an XML transformation. This happens each time a page is
served up. The system works fine, but I would like to find the anchor
in the HTML table of contents that matches the current page and change
its class. Obviously, I could do that with a client-side script, but
I'd much rather do that in ASP/vbscript.
Is there a way for vbscript to do that? I can't even get a test
script to find the id of the root. I've placed the script immediatly
after the script that does the transform.
Jeff Tag: Defrag Report Tag: 165075
logon script does not work anymore after applying SP2
Hello all,
SP2 was applied to our XP PRO workstation.
As a result, our logon script does not work any longer.
Such script used to show a small IE window indicating the current
logon process status.
It seems that properties such title and scrollbar are no longer
supported.
I don't have the script at hand right now but I'll post it tomorrow. I
can't believe we are the only ones noticing this problem.
Thank you very much,
Bye
Bar Tag: Defrag Report Tag: 165074
Processing a variable list of input parameters
Greetings,
I am trying to write a VB script that must check some drives (e.g. disk space).
It must be called:
check_drive.vbs drive1 drive2 ... driven
How can a I process a variable number of args (drive1 to n)?
I have tried something like:
...
Set oArgs = WScript.Arguments
Set WshShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Counter = oArgs.Count
Do
drive = oArgs(Counter) ' Does not work. PROBLEM!!!
MsgBox "Message: Drive is " &drive
Set Drv = fso.GetDrive(fso.GetDriveName(drive))
...
Counter = Counter - 1
If (Counter = 0) Then
' All parameters were proceded
Check = False ' set value of flag to False.
End If
Loop Until Check = False
Any help/suggestion is highly appreciated.
Thanks in advance for your help,
Kind Regards,
Rui Vilao. Tag: Defrag Report Tag: 165069
Writing extended file info into jpg
I recently learned how to read extended file info in this ng (subject:
Getting extended File infos of a File). Now how would I update/write this
information with vbscript? I have hundreds of images without descriptions.
In a database I currently have all my descriptions, subjects, keywords and
photo dates. I don't need help with the database part just how to write the
properties if it is at all possible.
thanks
LJB Tag: Defrag Report Tag: 165065
Need script to replace ACL. Please Help! :(
I have been searching to find a solution to my problem. Basically I
need a script that replaces permissions based on the permissions.
Example: I want all user who have "Full Control" to be changed to
"Modify".
I have inherited a share drive with thousands of folders and groups.
The people who set the permissions had the right intentions they just
set them incorrectly.
I appreciate anyone's help. Please let me know if this is in the wrong
group. Or, if you know of any other group that may be able to address
this issue.
Thanks,
Ian Tag: Defrag Report Tag: 165064
Scripting IE Title Problem
I have installed SP2 on my XP machine and I also downloaded and installed
the WSH 5.6 upgrade. No problems at all!
However, it took me awhile to notice that my VB scripts that use IE to
display menus have a quirk: when I set the title in the html and do a
'write' operation that the displayed window now has "http://" prefixing my
desired title.
How do I get rid of the "http://" prefix in the title bar?
Thanks in advance...
Dick Sutton Tag: Defrag Report Tag: 165059
Loading Video on a WebPage.
Friends,
Any Idea how to load a Video Media on a WebPages.
I mean I want the video to play in the web page.
Any help is appreciated.
TIA
--
Santosh Tag: Defrag Report Tag: 165057
MS Access Report with VBScript
I am trying to preview an MS Access report using a client-side
VBScript. When I execute the code below, it always prints the report
to the default printer, regardless of the view mode selected. I want
to be able to either preview the report or save a copy and view it in
the default viewer.
It appears to be ignoring all of the parameters after the report name.
I've also tried saving a copy of the report as a snapshot file using:
.OutputTo acOutputReport, "ProjectStats" , acFormatSNP,
"D:\snapfiles\test.snp", True
but am continually prompted with an "Output to " dialog.
<script language=vbscript>
Function RunReport (qry, sp, list)
Dim oAccess
Set oAccess = CreateObject("Access.Application")
oAccess.Visible = False
oAccess.OpenCurrentDatabase "D:/msp_xp2.mdb"
With oAccess.DoCmd
.OpenReport "ProjectStats",acViewPreview
.close
end with
End Function
</script>
Any help is greatly appreciated. Tag: Defrag Report Tag: 165054
Running VBScript in Outlook 2003
Hi,
System Details: Windows XP Professional SP2, Outlook 2003 SP1, IE6 SP2.
I have a Java appliaction that constructs a HTML Email and sends it to a
mail client. In the HTML Email I have embeded some VBSCRIPT which is called
via the ONCLICK event of an <A> tag. In the VBScript I create an XML document
then mail it via the Outlook API.
On Win2K and Outlook 2000 this worked fine but now, when I click the link in
Outlook 2003, nothing happens (no "Cannot Create ActiveX" messages either) !!!
I have tried putting the message into the Internet zone (with low security)
and the same occurred. I replaced my script with a simple message box call
and this never activates either. I've even tried the "One-off-form" registry
hack, again to no avail.
If I load the sent HTML into a browser it works OK so I am sure the syntax
is right.
Here is an example of the link and script...
<a style="cursor:hand;color:green;text-decoration:underline"
onclick="OpenNewMail('test','test')">OK</a>
<SCRIPT LANGUAGE="VBSCRIPT">
Sub OpenNewMail(strAddress, strSubjectLine)
MsgBox "In OpenNewMail"
End Sub
</SCRIPT>
Can anyone suggest how I can get vbscript to work in a HTML email in Outlook
2003 (has anyone got it to work!)? Is there some sort of new METADATA setting
to make the HTML Outlook 2003 friendly perhaps?
Any help would be massively appreciated as this is driving me barmy!
Cheers
sanx Tag: Defrag Report Tag: 165053
disable IPX without visiting every desk!
Hi all. I have seen info on how to set a couple of IPX settings via
script, but I cannot figure out how to disable the protocol
altogether. Anyone tackle this? Hat to visit each desktop... Tag: Defrag Report Tag: 165048
Update Windows 2000 registery: Internet Settings: LAN Settings: Automatic Configuration
I want to write a simple .VBS file that will change my LAN settings.
In my Windows 2000, if I go to Internet Settings >> Connections >> LAN
Settings, there is a section in the window called Automatic
Configuration. There are two tick boxes:
(1) Automatically Detect Settings
(2) Use Automatic Configuration Script
For some sites, I need only the first tick box checked. For some
sites, I need only the second tick box checked. I never need both
checked at once, or both unchecked at once.
I want to write one VBS file that will check #1. And then a second VBS
file to check #2.
I was thinking I could use something similar to the following code:
Dim WSHShell, RegLocate, RegLocate1
Set WSHShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next
RegLocate = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet
Settings\ZoneMap\ProxyByPass"
WSHShell.RegWrite RegLocate,"0","REG_DWORD"
WScript.Quit
...but I can't find the correct registry item to update.
Anybody have any clues? Tag: Defrag Report Tag: 165047
Select SQL money field incorrect large negative values
A production application using VBScript and SQL Server 2000 formats incorrect
value for a selected money field. Values between -200,000,000,000 and
-455,000,000,000 are displayed incorrectly using formatcurrency. The values
are correct in the database. The application works correctly in Windows
2000 but fails in Windows Server 2003.
app code:
...
strQry = "SELECT fielda, fieldb, amt, ....,
Set rsFACTS = oFACTS.Execute(strQry)
...
intAmtSGL = rsFACTS("amt")
...
%><td width="21%" align="right" ><%=formatcurrency(intAmtSGL)%></td><%
...
Field amt = -216556000000 - - ok in database (Viewed via Enterprise Manager)
Displays as $36,376,018,631.48
If for example, I update DB with amt = -255000000000
it displays as $29,820,018,631.48
???
--
Kent Smith Tag: Defrag Report Tag: 165044
Unbind F&P and Client for MS from all adapters via VBS?
I'm looking for a VBS script that will unbind (not un-install) File
and Printer sharing, along with Client for Microsoft Networks on all
adapters when run under both W2K and XPP?
Can anyone help me out here?
Thanks
dcc Tag: Defrag Report Tag: 165043
Is there any way of pulling up a defrag report for a machine?
I've seen a lot scripts that will automate the defrag but that's not what I'm after.
Tharg wrote:
> Is there any way of pulling up a defrag report for a machine?
>
> I've seen a lot scripts that will automate the defrag but that's not
> what I'm after.