Aracknid
12-Jun-2009, 12:45 PM
Hi,
I've written a batch file which does a bunch of 'stuff' and then calls bc2.exe to compare and generate reports. When I run this batch file on the machine it is supposed to be run on, it works fine.
When I use psexec.exe to remotely run the batch file from a different machine, it does not work.
I've used psexec a lot to run other files and it works fine. I'm positive it is not a configuration issue.
So, to clarify, the batch file does get executed. All the stuff in the batch file works as it should (I log a lot of info and that is working). When it gets to the bc2.exe line, it doesn't seem to run it and work.
The specifics of the line in the batch file look like this:
"C:\Program Files\Beyond Compare 2\BC2.exe" @C:\XYZ\CompareScirpt.txt %baselinefolder% %currentrun% /silent
It's almost as if beyond compare just doesn't want to work when launched this way.
[edit]
I added logging to my BC script, and I have a line at the top of the bc script as follows:
Load "COMAPIWS_Session"
which gives the error as follows:
6/12/2009 3:00:04 PM >> load "COMAPIWS_Session"
6/12/2009 3:00:04 PM Load Comparison: <->
6/12/2009 3:00:04 PM Script Error: Unable to load base folder
6/12/2009 3:00:04 PM >> User Canceled
6/12/2009 3:00:04 PM Script completed in 0.00 seconds
If I start BC up normally and choose this session, or if I run the batch file locally, it works fine.
I know that psexec doesn't like UNC paths, and my session was using one. So what I did was reload my session and change the UNC path to a mapped drive (W). It still doesn't work. So I experimented with not using the session and just loading the left and right sides and this time I can see that it doesn't like the mapped drive either. The log file shows:
6/12/2009 3:23:58 PM >> log verbose "C:\Compare_Log.log"
6/12/2009 3:23:58 PM User name: sqlexec
6/12/2009 3:23:58 PM >>
6/12/2009 3:23:58 PM >> #load "C:\COMWS_BeyondCompare_Script\COMAPIWS_Session"
6/12/2009 3:23:58 PM >> criteria rules-based
6/12/2009 3:23:58 PM >> load w:\COMAPIWS\CP2010\Baseline C:\COMWS_BeyondCompare_Script\CurrentRun
6/12/2009 3:23:58 PM The device is not currently connected but it is a remembered connection
6/12/2009 3:23:58 PM The device is not currently connected but it is a remembered connection
6/12/2009 3:23:58 PM Load Comparison: <-> C:\COMWS_BeyondCompare_Script\CurrentRun
6/12/2009 3:23:58 PM Script Error: Unable to load base folder
6/12/2009 3:23:58 PM >> User Canceled
6/12/2009 3:23:58 PM Script completed in 0.02 seconds
You can see that for some reason it doesn't recognize W either. Why would remotely running it cause it to not be able to load the base folder? I'm logging in as the same user?
Any ideas?
Thanks,
Aracknid
I've written a batch file which does a bunch of 'stuff' and then calls bc2.exe to compare and generate reports. When I run this batch file on the machine it is supposed to be run on, it works fine.
When I use psexec.exe to remotely run the batch file from a different machine, it does not work.
I've used psexec a lot to run other files and it works fine. I'm positive it is not a configuration issue.
So, to clarify, the batch file does get executed. All the stuff in the batch file works as it should (I log a lot of info and that is working). When it gets to the bc2.exe line, it doesn't seem to run it and work.
The specifics of the line in the batch file look like this:
"C:\Program Files\Beyond Compare 2\BC2.exe" @C:\XYZ\CompareScirpt.txt %baselinefolder% %currentrun% /silent
It's almost as if beyond compare just doesn't want to work when launched this way.
[edit]
I added logging to my BC script, and I have a line at the top of the bc script as follows:
Load "COMAPIWS_Session"
which gives the error as follows:
6/12/2009 3:00:04 PM >> load "COMAPIWS_Session"
6/12/2009 3:00:04 PM Load Comparison: <->
6/12/2009 3:00:04 PM Script Error: Unable to load base folder
6/12/2009 3:00:04 PM >> User Canceled
6/12/2009 3:00:04 PM Script completed in 0.00 seconds
If I start BC up normally and choose this session, or if I run the batch file locally, it works fine.
I know that psexec doesn't like UNC paths, and my session was using one. So what I did was reload my session and change the UNC path to a mapped drive (W). It still doesn't work. So I experimented with not using the session and just loading the left and right sides and this time I can see that it doesn't like the mapped drive either. The log file shows:
6/12/2009 3:23:58 PM >> log verbose "C:\Compare_Log.log"
6/12/2009 3:23:58 PM User name: sqlexec
6/12/2009 3:23:58 PM >>
6/12/2009 3:23:58 PM >> #load "C:\COMWS_BeyondCompare_Script\COMAPIWS_Session"
6/12/2009 3:23:58 PM >> criteria rules-based
6/12/2009 3:23:58 PM >> load w:\COMAPIWS\CP2010\Baseline C:\COMWS_BeyondCompare_Script\CurrentRun
6/12/2009 3:23:58 PM The device is not currently connected but it is a remembered connection
6/12/2009 3:23:58 PM The device is not currently connected but it is a remembered connection
6/12/2009 3:23:58 PM Load Comparison: <-> C:\COMWS_BeyondCompare_Script\CurrentRun
6/12/2009 3:23:58 PM Script Error: Unable to load base folder
6/12/2009 3:23:58 PM >> User Canceled
6/12/2009 3:23:58 PM Script completed in 0.02 seconds
You can see that for some reason it doesn't recognize W either. Why would remotely running it cause it to not be able to load the base folder? I'm logging in as the same user?
Any ideas?
Thanks,
Aracknid