|
Answer» Hi,
I'm working on creating a batch file for my company. I was working on it about 5 months ago, got side tracked and I am working on it again. The batch file is run from the company server, which is running Windows Server 2003 SP2. I Checked the DOS and it says it running WINDOWS Version 5.2.3790. 5 months ago, all DOS commands worked on the server, but now the server doesn't SEEM to want to recognize the CHDIR or CD DOS command. See below for example:
My problem is that the batch file is located on the D drive. So when I start the command it starts me off on C:\Documents and Setting\. When I type in CHDIR or CD and D:\location it does not give me an error. But in the next line, when its waiting for another command....it STILL lists me as being in C:\Documents and Settings\.
I double checked to see if I was maybe on the D drive, so I typed DIR....but it did not show any files from the D drive. I also tried calling my batch file, but it says it did not recognize the command. Which means, to me, that I'm still on the C drive.
Please help.You need to change to the server drive & directory
D:
WOULD change the drive, but CD /D d:/path allows you to change the drive as well as the directory at the same time.
If you wanted to change to the directory where your batch was, add this to near the start CD /D "%~dp0"
This takes the full name of the batch (%0) and STRIPS out the drive and directory from it .... the quotes are there in case there are spaces in the folder name
Good luck GrahamThanks Graham. That helped me out.
|