You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set wshShell = WScript.CreateObject("WScript.Shell") Set wshEnv = WshShell.Environment("User") 'Get the the script's directorySet fso = CreateObject("Scripting.FileSystemObject")cwd = fso.GetParentFolderName(WScript.ScriptFullName) 'Stores it in the %SimcPath% variablewshEnv("SimcPath") = cwd'Update %Path% when necessaryenvPath = wshEnv("Path")If Len(envPath) = 0 Then wshEnv("Path") = "%SimcPath%" changed=1ElseIf InStr(envPath, "%SimcPath%") = 0 Then wshEnv("Path") = envPath & ";%SimcPath%" changed=1End If'Notify the user about the changesmsg = "%SimcPath% was set to: " & vbNewLine & cwd & vbNewLine & vbNewLineIf changed = 1 Then msg = msg & "%Path% was changed for this user to:"Else msg = msg & "%Path% was already up-to-date for this user:"End Ifmsg = msg & vbNewLine & wshEnv("Path")MsgBox msg, vbOkOnly & vbInformation, "Success"