Hi,
How about (once you have confirmed that the node exists):
gsPCPhotoDir.Text = "C:"
' make sure you save the XML at the end
oXMLObject.Save strFileNameYouOpened
Spong
Why not just do this?
Dim Dom As Object
Set Dom = CreateObject("MSXML.DomDocument")
Dom.async = False
Dom.Load gsBASE_PATH & "\" & gsENV_PATH & "\" & gsDATA_PATH & "\System.xml"
Set gsPCPhotoDir = Dom.selectSingleNode("//SystemParams/Params/PCPHOTODIR")
if Not...
Hi,
I do not know if you have looked at this yet, but this works for me.
Set objNetwork = CreateObject("Wscript.Network")
objNetwork.AddWindowsPrinterConnection "\\10.0.0.1\HPLaserJet6MP"
' Set the printer to be the default printer
objNetwork.SetDefaultPrinter "\\10.0.0.1\HPLaserJet6MP"...
Change your script to:
Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "Z:", "\\myserver\myshare"
Set objNetwork = Nothing
The MapNetworkDrive does not accept the mapping with a trailing slash.
Spong
...Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each objNetAdapter in colNetAdapters
errEnable =...
This should be more what you are looking for:
Set Shell = WScript.CreateObject("WScript.Shell")
Sub Printtxtfile(filename)
Shell.Run "Notepad /p " & filename
End Sub
Spong
I would have used ShellExecute with the print verb.
URL:http://www.tek-tips.com/viewthread.cfm?qid=53365
The above link may help you get started on this.
Spong
Try this for an alternate solution:
strComputer = "."
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
Set objUser = GetObject("WinNT://DomainNameHere/UserNameHere")
objGroup.Add(objUser.ADsPath)
You can substitute a list of PCs in the strComputer list.
Spong
How about the following:
Function doSomething(a, b)
On Error Goto doSomethingError
' do some work here
doSomethingExit:
Exit Function
doSomethingError:
MsgBox "Error occured"
Resume doSomethingExit
End Function
I have not tested the above but should work for your problem...
Hi Patrick,
If you created the object using this as an example:
Set objIE = CreateObject("InternetExplorer.Application")
Set objDoc = objIE.Document
Then you could shut the window using this:
objDoc.Close
objIE.Close
Spong
If FileServ1 is the name of your server, then put quotes "" around the name. As it is, it is taken as a variable.
Tsuji was correct. Start the loop with:
Do While Not txtFileName.atendofstream=true
Spong
You could use Sendkeys as follows:
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.AppActivate "WordPerfect"
objShell.SendKeys "^{F4}"
Spong
I should have added this at the beginning... it would be useful!
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
Spong
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.