Would like to thank everyone who contributed and assisted with this matter. I have tested the way ShaneEP suggested and it worked fine. I was trying the code but had quotes nested inside the Shell and that was the problem all along. Finally got the code working successfully