Yes, I do know what is wrong. Some versions of Windows want quoted paths to use double quotes, not single quotes. I suspect that is the issue here.
However, you are using a macro symbol to identify the path to the file and you need to resolve macro symbols within double quotes, so we need to replace the single quotes.
Here is where a visit to the early part of the SAS Language manual would pay off. You would read about doubling and tripling quote marks to build strings and then find a way to have double quotes around the SAS filename path, and also have double quotes within the filename path.
The following syntax worked for me. Note the doubling of the quote marks before and after the path replacing the single quote marks.
31 %Let MyPath = C:\Documents and settings\david;
32
33 Filename SYSREQST Pipe "Del ""&MyPath.\deletecd.reg""";
34
35 Data _NULL_;
36 InFile SYSREQST;
37 Input;
38 Put _InFile_;
39 Run;
NOTE: The infile SYSREQST is:
Unnamed Pipe Access Device,
PROCESS=Del "C:\Documents and settings\david\deletecd.reg",
RECFM=V,LRECL=256
NOTE: 0 records were read from the infile SYSREQST.
NOTE: DATA statement used (Total process time):
real time 0.18 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
Be aware that the SAS Log Note that reports the "PROCESS" is extremely important. When you resolve a macro symbol into a command string, you need to review that string very carefully to ensure it has resolved as you expect. So if it doesn't work correctly again, check the process value first to ensure it has the correct path to the file you want to process. This is the most common problem found with building command strings from macro values.
Kind regards
David