Greetings my fellow Forum members!

Problem Statement: How to validate an input dat folder/directory path whether the path has any spaces

As-Is if there are any spaces in the folder/directory how to handle the path to work for shell based call functions/procs

As part of my existing search dat file program, I have a shell based exe program which works based on input path as "mydir" at below line of code
this "mydir" is based on user selected path from windows directories.

DRAPPPath = Application.ThisWorkbook.Path & "\bin\testdatsplitter.exe " & myDir & objFile.Name & " 10"

For example if "mydir" equals (if I have selected search path as) C:\Test\Test Program Files Level1\Test Program Files Level2\
Above shell based exe program doesnt work if there are any spaces in any folders like above between Test and Program and Files

Please let me know if anyone has any solution to resolve this spacing problem to run the shell program.