I'm helping a bud fix an application that has recently been changed over to using a UNC path. Before he could use a bat file to run
@echo off
echo %~z1
to get a file's size.
Now the bat file won't work because CMD does not support UNC paths as current directories. I thought about using pushd command to temporarily create a drive letter that points to the network resource but I'm thinking there has to be a more direct, cleaner way to do this I'm probably just not experience enough with CMD to know it yet.
Any suggestions or assistance would be greatly, appreciated!
Thanks.
Update
To clarify when the bat file is called (through a PHP file using exec() function) I get nothing in response. I tried a few ways of debugging (it's been a few days so I don't remember exactly what) but the most I could get was "Echo is off" or "The system cannot find the file specified." errors. I can copy/paste the file address into my Windows Explorer and I can find the file fine though.
Update II
It has been noted that the code shouldn't have a problem despite UNC not being supported. If this is true then what else could be the issue? Like I said before I can copy and paste the file paths that are given to the bat file and they open fine in windows explorer.
Update III
I tried timing how long the bat file took to execute and it seems to randomly either take almost no time or a little over a minute. So I'm guessing that might be my problem area. However when I run it via the ajax call its response time is about 550-650. I have no idea what would cause a bat file's execution time to vary by so much. Any ideas would be welcome!
Thanks in advance for any input!