Your technology certification is waiting. Enroll in Cloud Class ®
'============================== Objects ===========================================================
Set fso = CreateObject ("Scripting.FileSystemObject")
Set wshShell = CreateObject ("WScript.Shell")
'============================== Script variables ==================================================
Dim sBaseKey 'The base key for the script
sBaseKey = "HKCU\Software\MyCompany\Scripts\MyScriptName"
bHasBeenRun = "no"
'============================== Main Body =========================================================
On Error Resume Next
sCheck = lcase(wshShell.RegRead (sBaseKey + "\HasBeenRun"))
If sCheck = "yes" then
bHasBeenRun = "yes"
On Error GoTo 0
If lcase(bHasBeenRun) = "yes" then
'now run the app
'the path to the exe is the actual path, the 1 means a normal window, vbFalse says don't wait for it to return
shell.Run "<path to exe>\ Workshare.Professional.UserInit.exe", 1, vbFalse
Set wshShell = Nothing
Set fso = Nothing
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.