@@ -378,7 +378,7 @@ const validation = {
378378 /**
379379 * Ensures the Windows file path is valid and exists.
380380 * Resolves any environment variables to absolute paths.
381- * If no valide filePath is presented, deleted "windows" object.
381+ * If no valid filePath is presented, deleted "windows" object.
382382 *
383383 * @example
384384 * options = validateWindowsFilePath(options);
@@ -407,6 +407,37 @@ const validation = {
407407
408408 return options ;
409409 } ,
410+ /**
411+ * Ensures the windows.vbs file path is valid and exists.
412+ * Resolves any environment variables to absolute paths.
413+ * If no valid path is presented, use the default.
414+ *
415+ * @example
416+ * options = validateWindowsVBScript(options);
417+ *
418+ * @param {object } options User's options
419+ * @return {object } Validated or mutated user options
420+ */
421+ validateWindowsVBScriptPath : function ( options ) {
422+ if ( ! options . windows ) {
423+ return options ;
424+ }
425+
426+ options . windows . VBScriptPath = helpers . resolveWindowsEnvironmentVariables ( options . windows . VBScriptPath ) ;
427+
428+ if ( options . windows . VBScriptPath && ! fs . existsSync ( options . windows . VBScriptPath ) ) {
429+ options . windows . VBScriptPath = undefined ;
430+ }
431+
432+ if (
433+ ! options . windows . VBScriptPath ||
434+ typeof ( options . windows . VBScriptPath ) !== 'string'
435+ ) {
436+ options . windows . VBScriptPath = undefined ;
437+ }
438+
439+ return options ;
440+ } ,
410441 /**
411442 * Verifies or defaults the windowMode.
412443 *
@@ -577,6 +608,7 @@ const validation = {
577608 return options ;
578609 }
579610
611+ options = this . validateWindowsVBScriptPath ( options ) ;
580612 options = this . validateWindowsWindowMode ( options ) ;
581613 options = this . validateWindowsIcon ( options ) ;
582614 options = this . validateWindowsComment ( options ) ;
0 commit comments