Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SDETERS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sudden problem with old batch files

Status
Not open for further replies.

STN6

Electrical
Mar 3, 2008
4
Hello

I have a collection of batch files which have been proven, and all had worked until lately (I'm suspecting a windows update may be the source of my problem, but have not been able to find a solution.)

Problem: When executed a batch file will not properly execute calls/commands for the "local" directory - that is where the [Drive:][\Path\] don't exist.
eg. Del myfile.txt
Call myprog.exe

I can see that the command prompt ALWAYS defaults to C:\Windows\system32\ as of late.

If I open the command prompt directly I get a mesage indicating that "UNC paths are not supported" - and again the prompt defaults to C:\Windows\system32\

Anyone know a quick work-around?

Appreciate the help. Thanks.


 
Replies continue below

Recommended for you

Try
del .\myfile.txt
call .\myprog.exe

[ I'm working from memory; I hardly ever use DOS or Windows anymore. ]





Mike Halloran
Pembroke Pines, FL, USA
 
I'm confused. Why can't you just add
CD c:\working_directory to the batch file?

TTFN

FAQ731-376
 
IRstuff -

To some of my files - sure that would certainly fix the problem, but many of them are used in conjuction with inhouse programs and the working directory for them is not always known (for example some of these batch files can perform the same task in any directory which they reside).

These batch files had all been tested - this problem only surfaced recently. As I stated earlier, I believe a Windows update may have changed the way the CMD prompt functions.

Thanks.
 
Resolved. Thanks for any responses.

Turns out the IT department associated a new registy entry with everyones login script. This was done to facilitate a certain software upgrade, and forced the command prompt to C:\Windows\system32 when run. If anyone ever has the problem in the future - look for a registry entry called "AUTORUN" within the command prompt registry folder, and delete it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor