So, i am doing a project on 8051 core. I would like a output to be a .bin format than .hex. So, i use hex2bin.exe for that purpose. It is easy to create a batch file and execute it from User commands in Options For Target. But the trick is that i have 12 different projects. So i want to make 12 different binaries. Now i make a batch file which would take input from user and based on that input, that particular section of batch file is called and binary file is made successfully. But the problem is that i keep getting following error:
Error: Access is Denied
whenever i run batch file from Run Commands in Options for Target. But it runs fine when i run it simply double clicking.
Can someone plz help me figure this problem out.
Wrong working directlry?
Have you tried to let the batch file start with echo of where it was started from?
yes, i have tried that and it is fine. but still error is not fixed.
So since you could prove that the file was run, and that it did start in the correct directory, you then directly went ahead and figured out exactly which line in the file that gives this error?
By the way - have you verified that the script file isn't depending on any path - the path settings when you are at the command line need not match the path settings when Keil uVision runs the script.
What should be the directory ? what is meant by wrong directory?
what i am saying is that the access denied error comes only when i run in user command. Otherwise it works fine. What could be reason ?
already answered above "By the way - have you verified that the script file isn't depending on any path "
Erik
how can i verify that ?
if you just barely thought of this, you would realize that to "execute it from User commands in Options For Target" there is nothing hindering that you include a full path e.g. C:\myProject|batches\doit.bat
We do know (or do we?) that the tool can start the batch file. Because the OP have acknowledged (or have he?) that the current working directory when the script is started is the correct one.
The next thing is that any commands run by the script must either be in the path - or have a full path given.
And basic batch-file knowledge would be enough to know how a batch file when started can print the current search path.
Basic batch-file knowledge would also be engouh to subdivide the batch file and using printouts figure out exactly which line in the batch file that gives this error message.
Batch files, embedded programming or GUI programming doesn't matter. It's still required to be able to use own logical deductions to debug problems. What is known? What isn't known? Can something be done to reduce the problem into one or more smaller problems?
Per : find out what the path of the .bat file is (problem: if wrong the file does not run) Erik: why worry about it, just start path with drive letter and go on from there
But not from previous posts: Me: Have you tried to let the batch file start with echo of where it was started from? OP: yes, i have tried that and it is fine. but still error is not fixed.
That would imply (?) that uVision can start the batch file, i.e. that the issue isn't with finding the batch file. But that something inside the batch file have a path issue.
The issue here is that we have an OP who are not the slightest methodical, and who posts answers that may not really relate to the questions. So we do not know exactly where we stand.
In short - it's easiest to ignore this thread until the OP starts to do own, real, debugging. Methods to debug have already been explained in this thread.