GetGestureStatus Method [InkPicture Control] doesn't work. Help please
I am trying to use the GetGestureStatus method of the InkPicture ActiveX
control in VBScript, but it doesn't work, I always get the error 80040235
(The query type is missing). I don't know what it means. Here's the code:
<SCRIPT LANGUAGE="vbscript">
Set TheObject = Document.createElement("object")
document.body.appendChild(TheObject)
TheObject.classid = "clsid:04A1E553-FE36-4FDE-865E-344194E69424"
'msinkaut.InkPicture.1
TheObject.id = "picture"
TheObject.picture = LoadPicture("C:\bla.jpg")
TheObject.SizeMode = StretchImage
TheObject.enabled=true
sub picture_click()
msgbox "I am an InkPicture Event!"
end sub
TheObject.SetGestureStatus IAG_ArrowLeft, True 'Doesnt work
TheObject.GetGestureStatus(IAG_ArrowLeft) 'Doesnt work
TheObject.SetGestureStatus 61498, True 'Doesnt work
TheObject.GetGestureStatus(61498) 'Doesnt work
</SCRIPT>
It simply doesn't work! The method is explained here:
http://msdn2.microsoft.com/en-gb/library/ms702416.aspx
But as always Microsoft doesn't care about those who are using VBScript,
they only provide examples for Visual Basic. I am totally at a loss here,
can somebody help?
P.S. The following method works:
TheObject.SetEventInterest 4,true
msgbox TheObject.GetEventInterest (4)
So if SetEventInterest works, why don't SetEventInterest / GetGestureStatus
methods work? Tag: Install loopback by script Tag: 201537
Selecting an Excel Worksheet using a Function in VBS
Hello Everyone(I posted this question in the Excel newsgroup, but they tell
me to use:
Function funWorksheetInput() As String, but I don't think VBS uses that, or
at least it doesn't work for me!)
I have started the following code that will allow a user to drag and drop an
XLS file ontop of this vbs script, and it will display a list of all the
available worksheet names, which they can then choose the worksheet number
and it will select that worksheet (take you to that worksheet).
This is part of a bigger idea I have in my head, but so far I am stuck on
the following line:
objWorkbooks.Worksheets(funWorksheetInput).Select
Why can't I use my function as the input selection? I get "Script Out of
Range"
I can do the following hard coding:
objWorkbooks.Worksheets(2).Select
or
objWorkbooks.Worksheets("Sheet3").Select
Any help would be appreciated!
T
'vbs code start
Dim argsNamed, argsUnnamed
set argsNamed = WScript.Arguments.Named
set argsUnnamed = WScript.Arguments.Unnamed
Dim objExcelApp ' Excel application object
Set objExcelApp = WScript.CreateObject("Excel.Application")
objExcelApp.Visible = True
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
set objWorkbooks = objExcelApp.Workbooks.Open(argsUnnamed(file))
set objWorksheets = objWorkbooks.Worksheets
objWorkbooks.Worksheets(funWorksheetInput).Select
set objWorkbooks = Nothing
set objWorksheets = Nothing
set objRange = Nothing
Set objExcelApp = Nothing
Set argsNamed = Nothing
Set argsUnnamed = Nothing
Set fso = Nothing
WScript.Quit
Function funWorksheetInput
Dim arryWS, c, ws
arryWS = split( funGetWorksheetNames, ",")
For c = 0 to Ubound(arryWS) - 1
ws = ws & c+1 & "). " & arryWS(c)
ws = ws & vbCRLF
Next
strSourceMessage = "Select from one of the following worksheets:" & vbCrLf &
ws
funWorksheetInput = InputBox( strSourceMessage, "WorkSheet Selection", "1")
If funWorksheetInput = "" Then WScript.Quit(0)
End Function
Function funGetWorksheetNames
Dim s,ws
For s = 1 To objWorksheets.Count
ws = ws & objWorksheets(s).Name
ws = ws & ","
Next
funGetWorksheetNames = ws
End Function
'vbs code end Tag: Install loopback by script Tag: 201533
multiple dial up connections and multiple FTP
I need to make multiple dial up connections and do multiple FTP transfers on
each connection simultaneously.
Is this possible on a windows machine?
What are my options and procedures using vbscript? Tag: Install loopback by script Tag: 201530
Script Local Security Policy
Hey there,
I wrote some small scripts for collecting several information about a
computer. In addition I wrote a small script to install that.
Now I want the User running these "collector" scripts to deny the right
to logon locally (normally a setting in the local security setting) and
I want to get that done by my installer script.
I did not find any way to insert a users name into this policy.
Is it definitively not possible o did I miss something?
Thanks in advance for any hint!
Regards,
Achim Tag: Install loopback by script Tag: 201519
Stopping .vbs file from running
Sorry, I have this somewhere and can't find it. What is the code for
stopping a .vbs file from running? It would be the equivalent of the vba
command Exit Sub. Tag: Install loopback by script Tag: 201514
VBA or VBScript to extract filename from a long file path.
I'm not sure which board this should actually be on.
I have an access database with a single table and several thousand records
added each day..
One of the columns in each record is a file path with file name.
Examples:
H:\MainFolder\BillyGroup\FloridaFiles\VariousReportNames1234567.txt
or
H:\MainFolder\SusansGroup\GeorgiaFiles\MoreVariousReportNames1234301.txt
There may be about a half dozen different filefolder paths, and the files
themselves could be named anything. The file names are variable lengths but
always start with alpha characters, and always end with a 7-digit number.
and all are text files (.txt)
Here is what I want to do:
I want to extract only the file name in each record. and copy the filename
to either a field or variable to use in code in another part of this
project, or copy just the filename (minus the folder path) to another text
file that I can work with.
I was thinking of some kind of function to do this that I can call and go
all the way through the Access Database table to extract each filename in
each record. In the 2 examples mentioned above, I should endup with only:
VariousReportNames1234567.txt
or
MoreVariousReportNames1234301.txt
The source data is an Access Database table, but my output will be text
files, not access tables.
How do I extract just a filename? Tag: Install loopback by script Tag: 201500
vb script to remove a startup entry
i have this thing with adobe photo downloader, i don't want it
auto-loading - easily fixed, same as i did with hp image monitor
but i still want it available, so put it on the task bar on the left,
when i'm using the printer for functions that i want all the extras, i
click and it loads into the notification area just like it would on
startup befotre i changed it, and i can exit anytime
are you with me so far ? :)
ok, adobe does the same thing, except it writes itself into startup
when it executes
i've found a vbs script that i think will do it, but i don't know vbs,
really
somebody check it for me please ?
i think the only thing i need to change is
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Adobe
Photo Downloader"
has to be HKLM etc
and, um, i can write this into a bat/pif to execute C:\Program
Files\Adobe\Photoshop Album Starter Edition\3.0\Apps\apdproxy.exe to
load that, and then a line to run the reg edit directly after by a
direct command prompt call to the script file ?
so the bat would be :
C:\Program Files\Adobe\Photoshop Album Starter
Edition\3.0\Apps\apdproxy.exe
call killapdproxystartup.vbs
vbs code reads :
'vmb's remover for auto-insert on startup line by photoshop downloader
execution
'Based on fixes by Doug Knox and Kelly Theriot. original file
xp_pastitems.vbs
'designed to remove past items icon list in notification tray for
volume icon problem
Message = "we're about to alter the registry" & vbCR
Message = Message & "based on a vbs script by Doug Knox and Kelly
Theriot" & vbCR
Message = Message & "edited by -<VMB>- -restarting Windows shell now
to run vbs" & vbCR
Message = Message & "This will not harm your system." & vbCR & vbCR
Message = Message & "Continue?"
X = MsgBox(Message, vbYesNo, "Notice")
If X = 6 Then
On Error Resume Next
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegDelete
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Adobe
Photo Downloader"
Set WshShell = Nothing
Next
MsgBox "Finished." & vbcr & vbcr & "thanx Doug Knox and Kelly Theriot",
4096, "-<VMB>-"
Else
MsgBox "No changes were made to your system." & vbcr & vbcr & "thanx
Doug Knox and Kelly Theriot -<VMB>-", 4096, "User Cancelled"
End If
i have some programming, but not this - there's probably something
that doesn't make sense, but will it work ?
btw, if you want the original code for the past items thing, i can
post that -
i was going to so you could see what i did, but i figured to keep it
concise
thanx ! Tag: Install loopback by script Tag: 201489
Enable DNS Suffix Search order - New to VBScripting
Hello,
I would like to find a way to Select or Enable DNSSUFFIXSearchorder, I
have an existing script that works to populate the dnssuffixes but it
only works if this option is selected in the network properties of a
workstation, if it is not and left at default it fails.
Any suggestions or advice would be great.
Thank you. Tag: Install loopback by script Tag: 201482
question re: user account creation script
I am almost finished creating a user creation script for a school.
It reads data from a csv file to create all the attributes etc.
1. Is the following line acceptable:
objUser,Put "Display Name" strFirst & " " & strLast
2. The user is instructd to first create a spread sheet with appropriate
colums and then convert that to a csv file and then a txt file. The
instructions also say to strip any characters other then alphabetical
characters (e.g. hyphen, comma, and space) from the names. Would it be easy
to add lines to my script that double check that this has been done and to
remove them if they haven't been. (If removing is a lot of work, I can
cancel the creation of that particular user account and write a note to the
log file.). Would I basically use something like:
If instrFirst(",") or if instrFirst("-") or if instrFrist(" ")
Then (write log file entry and move on to next user)
EndIf
If instrLast(",") or if instrLast("-") or if instrLast(" ")
Then (write log file entry and move on to next user)
Else (continue on with script) Tag: Install loopback by script Tag: 201480
Win32_Product Install
Hi,
i tried to use the Install method of the Win32_Product class, as described
here:
http://www.microsoft.com/technet/scriptcenter/guide/sas_cpm_nila.mspx?mfr=true
But i have a problem with the command line parameters. If the command
contain parameters such as /qn or /l*v, it does not work. I tried all
possible combination; i tried to put the "/qn" switch in the options
parameters of the Install method, but it does'nt work. This is the script
simple (v. link above):
Const ALL_USERS = True
Set objService = GetObject("winmgmts:")
Set objSoftware = objService.Get("Win32_Product")
errReturn = objSoftware.Install("c:\scripts\database.msi", , ALL_USERS)
Where i must put the /qn switch?
I tried this method because with the run method (WshShell), i don't have any
control on the msi execution (i don't know in my script if the installation
was successfull, nor the error number). With the install method, i have a
return code from the msi. Does anyone know another way to get the control of
the msi execution in my script?
Thanks in advance.
--
Tyler Durden Tag: Install loopback by script Tag: 201474
ipaddress conversion
I wrote a jscript that outputs an ipaddress I stripped down function for BB
post. I want to have vbscript version also. Can anyone help me out.
jscript code
base=0x0AA00000; BASE ADDRESS START
node = 1000 starting number for example
range=256; number of addresses avail
ipaddress=range*node+base+0;
ipstring=ipaddress.toString(16); conver to hex string
octet1="0x"+ipstring.substring(0,1);
octet2="0x"+ipstring.substring(1,3);
octet3="0x"+ipstring.substring(3,5);
octet4="0x"+ipstring.substring(5,7);
octet1=octet1*1; back to string
octet2=octet2*1;
octet3=octet3*1;
octet4=octet4*1;
var test = (octet1 + "." + octet2 + "." + octet3 + "." + octet4);
WScript.StdOut.WriteLine(test);
The output is : 10.163.232.0 Tag: Install loopback by script Tag: 201452
New to VBScript
Any recommendations on (1) a VBScript editor and (2) good places to find
code snippets to start my journey with this?
TIA,
Roy Tag: Install loopback by script Tag: 201442
Why isn't this working?!?!?!
Ok, so I'm not the best at scripting...and I'm writing the code in
notepad, but my boss asked me to write a script that resets the
permissions on all the folders on the Private drive (for my test I'm
using C:\Private\). All the folders within C:\Private should be listed
as the user's login name (C:\Private\aadams\). Many of them have
different subfolders too. Basically, I need to have the script get
the username from the folder name and set (not replace) modify/owner
permissions on the folder and its subfolders... This is what I have
found and smashed together so far. It sort of works, but only on the
first folder...after that it looks like it gets kicked out of the
recursive sub and I don't know why!!! I set up about 3 test folders
with different usernames within C:\Private to test the script and each
user's subfolder has a MyDocs folder in it as well.
Ok...after all that...here's what I have:
----------------------------------
On Error Resume Next
Const FOR_READING = 1
strFolder = "c:\Private"
Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objNewFile = objFSO.CreateTextFile("Test.txt")
Set objFolder = objFSO.GetFolder(strFolder)
ShowSubFolders(objFolder)
objNewFile.WriteLine "Script is done..."
objNewFile.Close
Sub ShowSubFolders(objFolder)
Set colFolders = objFolder.SubFolders
For Each objSubFolder In colFolders
Dim Str, strUser, Seps(2)
Seps(0) = "C:\"
Seps(1) = "\"
Str = CStr(objFolder.Path)
objNewFile.WriteLine Str & " is Str"
Dim a
a = Tokenize(Str, Seps)
strUser = CStr(a(2))
objNewFile.WriteLine strUser & " is strUser"
ModifyAndOwn(strUser)
objNewFile.WriteLine "in 1st part of recurs " & strUser
Set colFiles = objSubFolder.Files
For Each objFile In colFiles
ModifyAndOwn(strUser)
objNewFile.WriteLine "in 2nd part of recurs " & strUser
Next
ShowSubFolders(objSubFolder)
Next
End Sub
Function ModifyAndOwn(strUserName)
strSetModify = "& xcacls.vbs ""c:\Private\"""& strUserName &"\ /e /g
""da\"""& strUserName &":m"
strSetOwner = "& subinacl /subdirectories c:\Private\"& strUserName
&" /setowner=da\"& strUserName &""
objShell.Run "%comspec% /k cd ""c:\windows\""" & strSetModify &
strSetOwner &""
objNewFile.WriteLine "in ModifyAndOwn " & strUserName
End Function
Function Tokenize(byVal TokenString, byRef TokenSeparators())
Dim NumWords, a()
NumWords = 0
Dim NumSeps
NumSeps = UBound(TokenSeparators)
Do
Dim SepIndex, SepPosition
SepPosition = 0
SepIndex = -1
for i = 0 to NumSeps-1
' Find location of separator in the string
Dim pos
pos = InStr(TokenString, TokenSeparators(i))
' Is the separator present, and is it closest to the beginning of
the string?
If pos > 0 and ( (SepPosition = 0) or (pos < SepPosition) ) Then
SepPosition = pos
SepIndex = i
End If
Next
' Did we find any separators?
If SepIndex < 0 Then
' None found - so the token is the remaining string
redim preserve a(NumWords+1)
a(NumWords) = TokenString
Else
' Found a token - pull out the substring
Dim substr
substr = Trim(Left(TokenString, SepPosition-1))
' Add the token to the list
redim preserve a(NumWords+1)
a(NumWords) = substr
' Cutoff the token we just found
Dim TrimPosition
TrimPosition = SepPosition+Len(TokenSeparators(SepIndex))
TokenString = Trim(Mid(TokenString, TrimPosition))
End If
NumWords = NumWords + 1
loop while (SepIndex >= 0)
Tokenize = a
End Function
-------------------
Please help me if you can! Tag: Install loopback by script Tag: 201436
How to involve an .vbs into another .vbs file?
Hi All
I have an big .vbs file, I would like to separate it into several smaller
files, how to involve all of them into an main file?
Jeff Tag: Install loopback by script Tag: 201433
Command Line Arguments
Is there a way to capture the command line arguments in vbscript? I tried
command(), and it didn't like that.
Thanks,
Dave Tag: Install loopback by script Tag: 201426
Problem with Populating an Instance in WMI
Just a beginning coder and having some problems writing Instances to
WMI:
I'm able to create the data class structure in WMI, but when I go to
query the mapped drives to write them to my static WMI Class
"MappedDrives" I get stuck. Code is attached. Scroll to ''Add
Instances to data class" for problem area. Thanks for any help...
option explicit
On Error Resume Next
Dim wbemCimtypeSint16
Dim wbemCimtypeSint32
Dim wbemCimtypeReal32
Dim wbemCimtypeReal64
Dim wbemCimtypeString
Dim wbemCimtypeBoolean
Dim wbemCimtypeObject
Dim wbemCimtypeSint8
Dim wbemCimtypeUint8
Dim wbemCimtypeUint16
Dim wbemCimtypeUint32
Dim wbemCimtypeSint64
Dim wbemCimtypeUint64
Dim wbemCimtypeDateTime
Dim wbemCimtypeReference
Dim wbemCimtypeChar16
wbemCimtypeSint16 =3D 2
wbemCimtypeSint32 =3D 3
wbemCimtypeReal32 =3D 4
wbemCimtypeReal64 =3D 5
wbemCimtypeString =3D 8
wbemCimtypeBoolean =3D 11
wbemCimtypeObject =3D 13
wbemCimtypeSint8 =3D 16
wbemCimtypeUint8 =3D 17
wbemCimtypeUint16 =3D 18
wbemCimtypeUint32 =3D 19
wbemCimtypeSint64 =3D 20
wbemCimtypeUint64 =3D 21
wbemCimtypeDateTime =3D 101
wbemCimtypeReference =3D 102
wbemCimtypeChar16 =3D 103
Dim oLocation, oServices, oInstances, oObject, oDataObject, oNewObject,
oRptObject, colDisks , objDisk
Set oLocation =3D CreateObject("WbemScripting.SWbemLocator")
'Remove classes
Set oServices =3D oLocation.ConnectServer(, "root\cimv2")
set oNewObject =3D oServices.Get("Mapped_Drives")
oNewObject.Delete_
Set oServices =3D oLocation.ConnectServer(, "root\cimv2\SMS")
set oNewObject =3D oServices.Get("Mapped_Drives")
oNewObject.Delete_
'Create data class structure
Set oServices =3D oLocation.ConnectServer(, "root\cimv2")
Set oDataObject =3D oServices.Get
oDataObject.Path_.Class =3D "Mapped_Drives"
oDataObject.Properties_.add "DeviceID", wbemCimtypeString
oDataObject.Properties_.add "Description", wbemCimtypeString
oDataObject.Properties_.add "ProviderName", wbemCimtypeString
oDataObject.Properties_("DeviceID").Qualifiers_.add "key", True
oDataObject.Put_
'********** CODE TESTED CLEAN THRU THIS POINT! **********
'********** CODE TESTED CLEAN THRU THIS POINT! **********
'********** CODE TESTED CLEAN THRU THIS POINT! **********
'Add Instances to data class
Set oServices =3D oLocation.ConnectServer(, "root\cimv2")
strComputer =3D "."
Set objWMIService =3D GetObject("winmgmts:" _
& "{impersonationLevel=3Dimpersonate}!\\" & strComputer &
"\root\cimv2")
Set colDisks =3D objWMIService.ExecQuery _
("Select * from Win32_LogicalDisk")
For each objDisk in colDisks
Set oNewObject =3D oServices.Get("Mapped_Drives").SpawnInstance_
oNewObject.DeviceID =3D objDisk.DeviceID
oNewObject.Description =3D objDisk.Description
oNewObject.ProviderName =3D objDisk.ProviderName
oNewObject.Put_ =20
Next=20
Reply =BB Tag: Install loopback by script Tag: 201423
Center Text In Word
I have a VB script that creates a word document and prints it.
I'd like to format it so that the text is centered on the page (I already
have the lines of text centered).
I can't seem to find this coding anywhere? Could someone please help me
out?
Is there a list of coding for a Word document?
Thanks! Tag: Install loopback by script Tag: 201420
Drop Down Input Box?
In my script I have a couple of input boxes. I'd like one of them to
contain a drop down list of choices.
Is there a way to do that?
Thanks,
Glenn Tag: Install loopback by script Tag: 201418
URL missing the "." in CDO HTML message
When creating a <a href> to a URL in the HTMLBody portion of a CDO
message, occasionally the displayed URL will be missing dots.
For example, http://www.google.com will come out http://wwwgoogle.com -
although, the href will correctly point to http://www.google.com.
Has anyone run into this problem?
Solved it?
Thanks.
Michael Tag: Install loopback by script Tag: 201414
Updating a db field with current date
Hi,
I have my vbs script set up to solicit info from the user and write that
info to the specified database.
I also want to be able to automatically update the record in the database
with the date it was changed.
I have objRecordSet("Date Used") =
But, I'm not sure what to ut after the equal sign. Any suggestions?
Thanks,
Glenn Tag: Install loopback by script Tag: 201413
Problem in invoking a remote script
I have faced the problem in invoking a remote script. I suspect it is a
working directory's problem. Below is the remote script, which will
called by the local pc. For your information, the remote program will
use some configuration files which is located in its program directory.
May iknow whether the current directory will be changed accordingly
based on the "objShell.CurrentDirectory = strProgramDir"? Thank you
Option Explicit
Dim strProgramDir, objShell, strProgram, intReturn
strProgramDir = "C:\RemoteProgram\bin"
strProgram = "RemoteProgram.exe"
Set objShell = CreateObject("Wscript.Shell")
objShell.CurrentDirectory = strProgramDir
intReturn = objShell.Run(strProgram, 0, True)
WSCript.echo intReturn
WSCript.Quit(intReturn) Tag: Install loopback by script Tag: 201397
How to call mofcomp in a vbscript
Hello All
Just wondering how I can call mofcomp.exe in a vbscript , here is what
I have written so far but the error I get is file not found , any
suggestion would be greatly appreciated.
Set objShell = CreateObject("WScript.Shell")
strWinDir= objShell.ExpandEnvironmentStrings("%WinDir%")
strdllDir=strWinDir & "\system32\wbem"
Set objFSO=CreateObject("Scripting.FileSystemObject")
Set objFiles=objFSO.GetFolder(strdllDir).Files
For Each file In objFiles
'If Right(file.name,3)="mof" Then
'objShell.Run "mofcomp.exe" & chr(34) & file & chr(34)
'wscript.echo file
'End If
Next
TIA
Ann Tag: Install loopback by script Tag: 201394
getting screen width and height broke recently
Guys,
For years I've had the code below to get screen size in a script to move
an agent character around:
With CreateObject("htmlfile").parentWindow
ScreenWidth = .screen.width
ScreenHeight = .screen.height
End With
I now get an 'Access Denied' on the second line. Not AV or IPS software
causing it as we can duplicate the problem on a test box without those
installed. PCs have IE6SP2 or IE7 installed. This was just reported in the
last few weeks and appears to be related to IE patches (just based on the
timing - haven't looked close enough yet). Run within SystemScripter the
output window says: Permission denied: 'screen'
All I have to do is change it to this:
With CreateObject("htmlfile")
With .parentWindow
ScreenWidth = .screen.width
ScreenHeight = .screen.height
End With
End With
And once again it works like a champ. Can anyone else duplicate this? Since
we use WMI for other things in our scripts I may just switch to using
CurrentHorizontalResolution and CurrentVerticalResolution from
Win32_VideoController, but this worked for so long I would like to know
what's up.
Thanks,
BZ Tag: Install loopback by script Tag: 201372
autorun in vbscript
Please...
with wich command vbscript i start relative program ?
i.e.: with a file "Document.doc" start word.exe
with a file "Spreadsheet.xls" start exec.exe
with a file "Image.jpg" start imageviewer.exe
thanks.
Sorry for my english Tag: Install loopback by script Tag: 201369
Changing file to uppercase
I need to convert the contents of a file to all upper case then FTP the
file. I need to have this run at night automatically. The data is
orginating from a SQL server and has to be sent in a csv format. any
thoughts on a quick fix to convert the contrnts to upper case?? Tag: Install loopback by script Tag: 201361
How to escape out of a loop
Hi,
I have a vbscript that checks through large text files looking for this and
that.
I loop through the lines using the Do while not EndOfTextStream() function.
Some of these files are huge.
Sometimes I realise that I need to stop the prog.
Is there a way I can programme combination of keys to escape from the loop ?
Some other method ?
Right now I'm crashing the process through the Ctrl + Alt + Del + Programme
Manager. None too elegant, I must admit.
Could someone please paste an example ? Or point me to a link.
Thanks in advance.
Andy Morton. Tag: Install loopback by script Tag: 201358
Problem Creating A Shortcut
I have a shorcut on my desktop that opens the downloaded version of
SQL Server 2005 Compact Edition Books Online
The shortcut includes these properties:
Target type Application
Target Location Help 8
Target "C:\Program Files\Common Files\Microsoft Shared\Help
8\dexplore.exe" /helpcol ms-help://MS.SSCE.v31.EN
The following vbs script tries to create the shortcut
Set wshObject = WScript.CreateObject("WScript.Shell")
deskTopFolder = wshObject.SpecialFolders("Desktop")
Set myShortcut = wshObject.CreateShortcut(desktopFolder & "\\SQL
Compact.lnk")
myShortcut.TargetPath = "'C:\Program Files\Common Files\Microsoft
Shared\Help 8\dexplore.exe' /helpcol ms-help://MS.SSCE.v31.EN"
MyShortcut.Save()
but using the generated shortcut I get the message
The item MS.SSCE.v31.EN that this shortcut refers to has been changed or
moved so this shortcut will no longer work.
The obvious difference is in the lack of Target Location in the script but
there is no property for Target Location. Tag: Install loopback by script Tag: 201346
TakeOwnershipEx returns 2
hi!
i'm building a script to 'backup' data from computers before reinstalling SO
so i've tryed :
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFolders = objWMIService.ExecQuery _
("Select * From Win32_Directory Where Name = 'C:\\Documents and Settings\\xx'")
For Each objFolder in colFolders
MsgBox objFolder.TakeOwnerShipEx(True)
Next
so i can copy the folder which it was made private
but the msgbox shows me "2" meaning " Access was denied."
any sugestions ?
only by script not interfering with "properties -> security"
thanks in advance
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com Tag: Install loopback by script Tag: 201345
Problem creating shortcut
I have a desktop shortcut which opens the following:
SQL Server 2005 Compact Edition Books Online
The shortcut has:
Target Type Application
Target Location Help 8
Target "C:\Program Files\Common Files\Microsoft
Shared\Help 8
\dexplore.exe" /helpcol
ms-help://MS.SSCE.v31.EN
I have tried to create this shortcut in vbs:
Set wshObject = WScript.CreateObject("WScript.Shell")
deskTopFolder = wshObject.SpecialFolders("Desktop")
Set myShortcut = wshObject.CreateShortcut(desktopFolder & "\\SQL
Compact.lnk")
myShortcut.TargetPath = "'C:\Program Files\Common Files\Microsoft
Shared\Help 8\dexplore.exe' /helpcol ms-help://MS.SSCE.v31.EN"
MyShortcut.Save()
but this message appears:
The item MS.SSCE.v31.EN that this shortcut refers to has been changed or
moved, so this shortcutwill no longer work.
The obvious difference is in the treatment of Target Location. I tried
setting myShortcut.Target.Location but there is nosuch property. Tag: Install loopback by script Tag: 201344
How to list all (recursively) empty folders ?
I would like to have a script which lists me all folders in a directory tree
which are empty (= which contain no files and folders)
If a folder contains other folders which in turn are empty then the parent folder should be
seen as empty as well.
I could imagine that such a script already exists.
Where can I find such a script?
Paul Tag: Install loopback by script Tag: 201342
Simple Array Value Conversion
Hello,
I'm new with VB and need some assistance with creating a function to
convert the values of one array and place them in another. So far I
have:
'---------------------------------------
MyArray(2)
MyArray(0) = "Old Hat"
MyArray(1) = "Old Shirt"
MyArray(2) = "Old Shoe"
Public Function Convert(MyArray As Array) As Array
Dim x, i
For Each x In MyArray
x=Replace(x ,"Old","New")
MyArray(i) = x
i = i +1
Next
End Function
Call Covert(MyNewArray(2))
'---------------------------------------
Seems valid to me? However, no matter how I word it, I keep getting
stuck with either no values in MyNewArray or errors like: "Object
reference not set to an instance of an object" or "Expression is a
value and therefore cannot be the target of an assignment."
Any ideas? Tag: Install loopback by script Tag: 201326
Network Drive Label is "Network Drive (H:)
Here's the snippet of code I'm using:
If InStr(strGroup, lcase(Staff_Group)) Then
objNetwork.MapNetworkDrive "H:","\\blah\General"
objShell.NameSpace("H:").Self.Name = "General"
Now when I login as someone in the Staff Group and I open windows
explorer I for a share name I see "Network Drive (H:)" rather then
"General (H:)" any ideas why?
Thanks for the help.
-Chris Matera Tag: Install loopback by script Tag: 201325
Cross-Forest - IADsGroup::Add receiving error 80072030 "There is no such object on the server"
When running a script to add a user from forest abc, to a domain local
group in forest xyz, I receive an error as follows:
80072030 "There is no such object on the server"
This is a snippet of the code I am using to perform the procedure:
=================================================
set objGroup = GetObject("LDAP://cn=Local Group,ou=Test,dc=xyz,dc=com")
set objUser = GetObject("LDAP://cn=John Doe,ou=Test,dc=abc,dc=com")
wscript.echo "Group:" & objgroup.adspath & vbcrlf & "User:" &
objUser.adspath
objGroup.add(objUser.adspath)
===================================================
The same code will add the user to the group if the domains are in the
same forest. If the domains are in two forests with a trust, it will
not work.
I have no trouble using Active Directory Users & Computers to add the
user to the group.
I have tried running the script on servers in both forests.
The echo works in all the above scenarios, so I know the GetObject is
working. The script will always fail on the objGroup.add.
I have also modified the LDAP requests so to specify a dc
(LDAP://dc.xyz.com/cn=Local Group,ou=Test,dc=xyz,dc=com).
Thank you for your time! Tag: Install loopback by script Tag: 201313
script problem
Hi
I have a problem with the script below, when i run it locally it gives an
error "Invalid class string /texting/text_test.asp, line 18"
Which i assume is because i don't have SOAP toolkit 3.0 installed. (is that
something a can install on windows xp running iis?)
I have then tried the same script with our webhosts and it still doesn't
work even though they DO have SOAP 3.0 installed. I'm very new to this,
could anyone please give some guidance. Many thanks
Dave
<%@LANGUAGE="VBSCRIPT"%>
<%
Dim oSOAP
Dim Result
Client_ID="xxxxxxxxxx"
Client_Pass="xxxxxxxxxx"
Client_Ref="123456789"
Billing_ref="123456789"
Connection="1"
Originator="davetext"
Otype="1"
Destination="+447748363936"
Body="it is a bit of test text"
SMS_type="0"
SMS_encoding="0"
Set oSOAP = Server.CreateObject("MSSOAPLib30.SoapClient30")
oSOAP.ClientProperty("ServerHTTPRequest") = True
oSOAP.mssoapinit("http://ws.textanywhere.net/ta_SMS.asmx?wsdl")
Result =
oSOAP.SendSMS(Client_ID,Client_Pass,Client_Ref,Billing_ref,Connection,Originator,Otype,Destination,Body,SMS_type,SMS_encoding)
SET oSOAP = nothing
Response.write("The Function SendSMS Returns (Sequence Status):" & Result)
%> Tag: Install loopback by script Tag: 201307
Loading a delimited file into SQL Server DB, must encrypt some fields
Hi,
I have a file that is updated daily that I need to load into a SQL
Database. This part I can do easily enough but I need to be able to
encrypt certain fields and then decrypt them to display them in an ASP
app.
Any ideas how I can do that?
Thanks a lot in advance. Tag: Install loopback by script Tag: 201306
VBScript to change the domain in Active Directory Users and Computer
Hey guys,
I am looking for a script when run can kick off AD users and computers
and change the domain as specified in the script.
Can this be done Please and any help wuld be really appreciated.
Regards
Singh. Tag: Install loopback by script Tag: 201302
remove unicode from text file
im hoping someone can point me in the right direction here-
im looking for a script that will rip through a directory of text files,
removing garbage unicode that causes "unexpected end of file" errors during
my sql server bulk insert process.
tia
jt Tag: Install loopback by script Tag: 201298
Does VBscript support " & _" for long strings?
I know in Word and Excel VBA macros, I can set a long string using
& vbCrLf & _
to continue the string on the next line. I seem to be getting an error in a
script using this. Then again, it may well be something else. So I thought
I'd check on this while I look over everything else just to make sure this
is okay in scripting.
Thanks.
Ed Tag: Install loopback by script Tag: 201291
WSF file and function calls...
Hi, folks!
I have a WSF script file that I'm working on that goes something like
this:
I am trying to make a function call in a VBScript block where the
function has been defined in a JScript block. Naturally, I am getting
an error, "Variable is undefined: 'ShowUses' ". How can I make this
function call work, if possible?
====================
<?xml version="1.0" encoding="utf-8" ?>
<package>
<job id="Job1">
<script src="LibraryFile.vbs" language="VBScript" />
<script language="VBScript">
ShowUses() 'Call made here
</script>
<script language="JScript">
function ShowUses() //function defined here
{
...
}
</script>
</job>
</package>
====================
TIA... Tag: Install loopback by script Tag: 201282
transfering datas from a program to another
hi there
first of all I apologize for my bad english.
I've a problem, a vbs program (prog1.vbs) calls another one (prog2.vbs)
and passes datas to it.
The datas are strings, a problem occurs when there is a space in a data,
it's seen as 2 datas because the data separator is the space.
What is the solution for this problem?
example of my programs:
******** prog1.vbs *********
Set Shell = Wscript.CreateObject("Wscript.Shell")
data = InputBox("Data?","Data")
shell.run "prog2.vbs"&" "&data
****************************
******** prog2.vbs *********
wscript.echo args(0)
****************************
If I enter "AB" then "AB" is displayed
If I enter "A B" then only "A" is displayed
Please note that in the real life many datas are transfered from the 1st
program to the 2nd and in each of them it could have many space.
Thanks for your help
phil Tag: Install loopback by script Tag: 201280
"Left" is an invalid procedure??
I am trying to get and parse the names of the processes running on my
computer. I want to separate the process names into the name and the
extension. I'm trying this script (based on one given me by jw
("mr_unreliable"). Any help is greatly appreciated.
Ed
Option Explicit
Dim sProcList ' as string
Dim oWMI, Process ' as objects
Dim sName, sExt ' as string
Dim sProc ' as string
Dim nPos ' as number
Set oWMI = GetObject("winmgmts:")
for each Process in oWMI.InstancesOf("Win32_Process")
sProc = Process.Name
nPos = InStr(sProc,".")
sName = Left(sProc, (nPos - 1))
sExt = Right(sProc, Len(sProc - nPos))
MsgBox sProc & vbCrLf & sName & vbCrLf & sExt
Next
Set oWMI = nothing ' clean up
Wscript.Quit Tag: Install loopback by script Tag: 201276
LANGUAGE="VBScript.Encode" does not work in a FOR events
I have used the following syntax without any problem:
<SCRIPT language=VBScript.Encode
src="OutilsAdministratifs/include/vbs/AdminToolsEvents.vbs"></SCRIPT>
but my problem is when I try to use the LANGUAGE="VBScript.Encode" directive
in a FOR event as below:
<SCRIPT LANGUAGE="VBScript.Encode" FOR="obtnCleanUp" EVENT="onclick()" >
The event is captured ok but the (encripted) script then gives an error on
line 1 - which begins with a # (hash) symbol.
Any idea?
Kind regards
--
IT Analyst
London - UK
http://uk.geocities.com/josephoget/a2z/ilo/ Tag: Install loopback by script Tag: 201269
.vbs as batch user -> SWbemObjectSet: Access denied
Hi
I am executing a .bat which runs another script inside:
cscript d:\q2.vbs
q2.vbs:
...
Query = "Select * From Win32_PerfRawData_MSMQ_MSMQQueue where Name="""
& Queue & """"
Dim objs ' As ISWbemObjectSet
Set objs = Service.ExecQuery(Query)
...
when the .bat is launched directly (user logged in in windows) or with
the help of 'runas ...' , (both times with //B -> batch mode) the
script works, but when launching it as a batch user in a service
process, the execution of the query returns the following error:
d:\q2.vbs(28, 1) SWbemObjectSet: Access denied
In the latter case, the user runs as a service with the right to create
a session, and the .bat is executed with that user in batch mode.
So, is there a difference in terms of execution rights between
launching something as a "user" in "batch mode", and launching it with
the "user service in batch mode" ?
Thank you for any help Tag: Install loopback by script Tag: 201268
FOF_NOCONFIRMATION Not Working
Hi All,
I am trying to write a script that will backup a couple of networked
folders to a removeable hard drive everyday. It is about 10Gig of
data, so I scheduled the script to run in the middle of the night. The
problem is I cannot get the FOF_NOCONFIRMATION flag to work, so the "Do
you wish to overwrite" dialog continually pops up, and Needless to say,
I am not around to click "Yes to All" The script is below. Thanks for
your help.
Dave
DayOfWeek = WeekdayName(Weekday(Now))
Const FOF_NOCONFIRMATION = &H10
BackupFolder1 = "G:\Backup\" & DayOfWeek & "\Engineering"
BackupFolder2 = "G:\Backup\" & DayOfWeek & "\Production"
Set objShell = CreateObject("Shell.Application")
Set objBackupFolder1 = objShell.NameSpace(BackupFolder1)
Set objBackupFolder2 = objShell.NameSpace(BackupFolder2)
objBackupFolder1.CopyHere "N:*", FOF_NOCONFIRMATION
objBackupFolder2.CopyHere "P:*", FOF_NOCONFIRMATION Tag: Install loopback by script Tag: 201265
Email msg "someone is sending in your name" from Outlook
I am creating and sending a report via e-mail. When I run the script
on a mule machine i recieve a yes/no box from Outlook saying that
someone is trying to send an email in the clients name. I have read
several posts on this problem, but they have not answered why this
failure does not happen on my workstation with myself logged in! I
only get the error on other machines with other logons. I have used
Outlook 2003 and 2007, I have made the user network and local admin,
but everything short of my machine with my logon presents the message.
below is the code that is creating and sending the e-mail.
Set objOL = CreateObject("Outlook.Application")
Set objMSG = objOL.CreateItem(0)
With objMSG
.Subject = "SyncToy"
.To = "hooah@domain.com"
.Body = Msg
.Send
End With
- James Tag: Install loopback by script Tag: 201261
Problem with Bulk Insert in VBScript.
Hi All,
I am a newbie to VBScript.
I have a script that copies files from remote server to local drive
and then bulk inserts the data into database by parsing the local file.
Sometimes the data contains garbage characters so bulk insert fails
and i have to manually edit the contents and re run the script.
Is there any way in VBScript (like line by line scan and then
insert) through which i can automate the
manual process of error detection and correction mentioned above?
Thanks in advance!
-Ashutosh. Tag: Install loopback by script Tag: 201251
Execute file based upon client OU Membership
I have a file that I want to execute via VBS logon script when the client
machine is a member of a certain OU. I think I can use the following to
launch the program on the client machine, but can you help me with the logic
to determine if the client machine is in the correct OU?
Thanks
set objShell=CreateObject("Wscript.Shell")
objShell.Run("%SystemDrive%\Path\file.exe")
--
Patrick Rouse
Microsoft MVP - Terminal Server
http://www.sessioncomputing.com Tag: Install loopback by script Tag: 201250
Question to "Populating a pull down list in a .hta from AD"
I have found this script in the archives from this site.
It works fine. But i need not the Query:
iUserControlFlags = oUser.userAccountControl
If (iUserControlFlags And &H2) <> 0 Then
w "<b>Account is disabled!<br></b>"
End If
I need the Query oUser.logonHours
If (iUserControlFlags And &H2) <> 0 Then
w "<b>Account is disabled!<br></b>"
w "Button" enable Account
what must i change when i will start a query for logonHours.
Sorry im a very Neebie
Thanks
Holger
ps. Sorry for my english
--
HolgerH
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------ Tag: Install loopback by script Tag: 201239
Hi,
someone know how to install loopback by script ?