Msgbox "Error " & Err & ": " & Error$ & " encountered at line " & Erl & " of " & Getthreadinfo( 1 ) & ".", , "Error encountered. If Dir$( strDirStruct$, ATTR_DIRECTORY ) = "" Then '// directory doesn't exist - create it StrDirStruct$ = strDirStruct & varAllDirs ( i ) VarAllDirs = Split( pstrFullPath$, "\" )įor i = (Lbound( varAllDirs ) + 1 ) To Ubound( varAllDirs ) Msgbox "The root directory is invalid - unable to continue.", MB_OK + MB_ICONEXCLAMATION, "Unable to continue. If Dir$( strRoot$, ATTR_DIRECTORY ) = "" Then '// the root directory is invalid StrRoot$ = Left( pstrFullPath$, 1 ) & ":\" Msgbox "The path could not be interpreted - unable to continue.", MB_OK + MB_ICONEXCLAMATION, "Unable to continue. If Not(Instr( pstrFullPath$, ":\" ) = 2 ) Then '// Function returns true if it is able to create the given directory structure, otherwise '// necessary directory structure on the local hard drive assuming OS to be Win32. '// Given a path as input, this function will attempt to traverse the path and create the WScript.Echo "NSD Error " & Err.Descriptionįunction createPath ( pstrFullPath As String) As Boolean ObjWshShell.CurrentDirectory = GetDataDir() If Instr (objOperatingSystem.Caption, "Windows 2000") > 0 Then Set colOperatingSystems = objWMIService.ExecQuery _įor Each objOperatingSystem in colOperatingSystems Set objWMIService = GetObject("winmgmts:" _ StrValue = objWshShell.RegRead("HKLM\SOFTWARE\Lotus\Notes\DataPath") StrValue = objWshShell.RegRead("HKLM\SOFTWARE\Lotus\Notes\Path") Set objWshShell = WScript.CreateObject("WScript.Shell") so I think this sample is useful when you want to access Notes program/data directory automatically in the batch file. You can run this VBS file just by copying it to any directory on your computer and double-click the file. this is why I created this command with VBScript.īy using VBScript, I can access registry value thus Notes program/data directory information can be retrieved from the registry. I also created the batch file like that but I hated to edit the batch file every time it is copied to a different environment. Some of you may have experience to create batch file to kick NSD command.