It’s not very much documented, but if you have a lot of WordPerfect files, try renaming their extensions to .DOC. Word will load them, unless they are very old files from WordPerfect for DOS.
If you have a huge tree of WPD files, use a batch file like this:
For /R "X:\TOP_OF_TREE" %%G in (.) Do (
Echo now in %%G
ren *.wpd *.doc
Set objNetwork = CreateObject("WScript.Network")
Set objWinntComp = GetObject("WinNT://" & objNetwork.UserDomain & "/" & objNetwork.ComputerName & ",computer")
MsgBox "WinNT://" & objNetwork.UserDomain & "/" & objNetwork.ComputerName & ",computer"
strGroupToCheck = "GROUP_TO_DETECT"
If IsMemberOfGroup(objNetwork.UserDomain, objWinntComp, strGroupToCheck) = True Then
MsgBox "You are a member of " & strGroupToCheck
ElseIf IsMemberOfGroup(objNetwork.UserDomain, objWinntComp, strGroupToCheck) = False Then
MsgBox "You are NOT a member of " & strGroupToCheck
ElseIf IsMemberOfGroup(objNetwork.UserDomain, objWinntComp, strGroupToCheck) = "Error" Then
MsgBox "There was no group found called " & strGroupToCheck
Function IsMemberOfGroup(strUserDomain, objComp, strGroup) 'the user is a member of a specified group
IsMemberOfGroup = False
On Error Resume Next
Set objGroup = GetObject("WinNT://" & strUserDomain & "/" & strGroup & ",group")
If Err.Number Then
IsMemberOfGroup = "Error"
IsMemberOfGroup = objGroup.IsMember(objComp.ADsPath & "$")
for /D %%Q in (C:\*) do echo Directory: %%Q
for %%Q in (C:\*) do echo File: %%Q
The above is a solid batch file — if you use the logic in the command shell, use single percents, not doubles!
The below is revised from here. It works well, as long as a reference to the Microsoft Office [currentversion] Type Library is created. This is confirmed to work well in Access 2010.
Public Function ChooseFile() As String
.AllowMultiSelect = False 'Select only one file
.Title = "Choose file" 'Set dialog title
.ButtonName = "Choose" 'Set the button caption
'.Filters.Clear 'Make sure the filter list is clear
'Add 2 filters
'.Filters.Add "JPEGs", "*.jpg"
'.Filters.Add "Bitmaps", "*.bmp"
'.FilterIndex = 2 ' Set the filter index to 2
'.Filters.Add "All", "*.*"
'Set initial path
.InitialFileName = ""
'Optionally show files as thumbnails
'.InitialView = msoFileDialogViewThumbnail
.InitialView = msoFileDialogViewList
'Show the dialog and test the return
If .Show = 0 Then
'didn't pick a file - exit sub
ChooseFile = ""
'Should be only one file name - grab it
ChooseFile = Trim(.SelectedItems(1))
'On Error Resume Next 'Set error trap
Here is a VBscript which, if edited for your Gmail account and environment, will work well on anything XP, Server 2003, or above. It does not require any additional installations, CDO is an object built in to Windows:
EmailSubject = "Sending Email by CDO"
EmailBody = "This is the body of a message sent via" & vbCRLF & _
"a CDO.Message object using SMTP authentication."
Const EmailFrom = "firstname.lastname@example.org"
Const EmailFromName = "My Very Own Name"
Const EmailTo = "email@example.com"
Const SMTPServer = "smtp.gmail.com"
Const SMTPLogon = "firstname.lastname@example.org"
Const SMTPPassword = "gMaIlPaSsWoRd"
Const SMTPSSL = True
Const SMTPPort = 465
Const cdoSendUsingPickup = 1 'Send message using local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using SMTP over TCP/IP networking.
Const cdoAnonymous = 0 ' No authentication
Const cdoBasic = 1 ' BASIC clear text authentication
Const cdoNTLM = 2 ' NTLM, Microsoft proprietary authentication
' First, create the message
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = EmailSubject
objMessage.From = """" & EmailFromName & """ <" & EmailFrom & ">"
objMessage.To = EmailTo
objMessage.TextBody = EmailBody
' Second, configure the server
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
("http://schemas.microsoft.com/cdo/configuration/sendusername") = SMTPLogon
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = SMTPPassword
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = SMTPPort
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = SMTPSSL
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
' Now send the message!
After a whole lot of looking:
The above requires Microsoft SMTP to be installed, which means no SMTP auth on the outbound — but a solution to that is at hand. Use this Gmail-sending VBscript, as the “action” to the error event list Paul Hite gives us:
and we’re in! I will try to get permission from Paul to rewrite all of this step-by-step in detail. For now, the idea is, we set up a “scheduled” task which triggers on the above event list (and not by a timed schedule). We go to Server Manager, Configuration, Task Scheduler, Task Scheduler Library, Microsoft, Windows, and Backup, and create a new task, beginning the task on an Event, settings Custom not Basic, with a New Event Filter; set it “By log”, and drill down “Applications and Services Logs”, “Microsoft”, “Windows”, “Backup”, and choose “Operational”. Then, set its “Action” is the above-mentioned VBscript.
And if we want a separate notification on successes, we can make a copy of the VBscript with a “success” message, and instead of the above error event list, we just use event 4.
This works, to back up C drive to \\DEST_SERVER\E$\SHARE, if disk2vhd.exe is within the path:
REM A simple backup system using disk2vhd
REM version 1.3, by J.E.B., 2011-02-22
REM requires 'disk2vhd.exe' to be in the path
REM "DRIVES" can be one drive identifier with colon, multiple separated by spaces,
REM or asterisk for all.
REM "DEST" can be a drive letter or a UNC.
REM Keep most recent 4 VHD files in DEST, delete the rest
for /f "skip=4 tokens=* delims= " %%a in ('dir/b/o-d %DEST%\*.VHD') do (
REM Backup to VHD
DISK2VHD %DRIVES% %DEST%\D2VBK--%date:~-10,2%%date:~-7,2%%date:~-4,4%_TS.VHD
Put the below in a VBS file and run it (from a batch file perhaps) with ‘wscript filename.vbs’.
' The name of the share.
strShareName = "SHARE"
' SERVERNAME has to be the hostname of the machine containing the sahre
Set objfServer = GetObject("WinNT://SERVERNAME/lanmanserver")
objfServer.Delete "Fileshare", strShareName
Set objfServer= Nothing