Question: I have an access database that points to a linked text file saved in the network. I’ve setup the following:

1. A batch file that opens the DB and runs a macro.
2. A scheduled Windows task that runs daily to kick-start the batch file. The process used to run with no issue, but lately I started getting this error message ‘M:\’ *is not a valid path. Make sure the path name is spelled correctly and you are connected to the server on which the file resides*.
Please note the following:
3. The windows scheduler runs with no issue.
4. The database opens
5. The Macro runs
6. The process throws the above error message only at the step related to the linked text file.

**The strange thing is that when I run the batch file manually, the process runs like a clock and gets completed successfully (txt file path gets recognized).**

Any idea about how to deal with the above issue? Please

Your assistance is appreciated
Thanks,
Ben

Answer: 
If we want to match 1 only, then we can use the start (`^`) and end (`$`) of the string to denote that there are no characters after or before 'C'

```
grep("^C$",s)
#[1] 1

```

### data

```
s<- c("C","C++","java")

```
```
s<-c("C","C++","java")    
which(s %in% "C")

```

`grep()` gives a positive result for any match within a string