vbscript "C:\\\\Folder" path issues

davidam

Active Member
Joined
May 28, 2010
Messages
497
Office Version
  1. 2021
Platform
  1. Windows
While testing my vb script to monitor a directory for new files, it works fine when the monitored directory is listed as follows:
Code:
strComputer = "."
strDirToMonitor = "C:\\\\Folder"
However, I need to monitor a subdirectory :
Code:
strComputer = "."
strDirToMonitor = "C:\Folder\Subfolder"
and the Windows Script Host will have none of it. Can someone show me how to write this subdirectory path so this will work?
Thank you
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
The above issue has been partially resolved by using a path like this:
Code:
"C:\\\\Folder\\\\Subfolder"
however, now I have a new issue. In my test, If I have the monitored folder on the C drive, a message box pops up when the monitored folder has changed. IF the subfolder is monitored, as above, then I get multiple message boxes. Would appreciate any suggestions. Thank you.
 
Upvote 0

Forum statistics

Threads
1,225,523
Messages
6,185,467
Members
453,296
Latest member
zashue22

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top