1.

Solve : batch file not working when double-clicked.?

Answer»

I have a PERL script that takes 2 arguments. The script connects to a DATABASE to retrive some data. I want to use batch file to call this script.

in my batch file, i have:
c:\perl\bin\perl myperl.pl arg1 arg2

Problem: if i manually type in the batch filename in the dos-prompt, the script runs perfectly. But if I just double CLICK the batch file, on the popped up dos prompt window, I get an error saying access denied to connect to the database.

Can someone pls HELP? Thanks.@echo off
echo.
call c:\perl\bin\perl myperl.pl arg1 arg2
pause
exit


save that as a batch fileI think its better not to have the pause:

@echo off
echo.
call c:\perl\bin\perl myperl.pl arg1 arg2
pause
exitwhy no pause? u can see what errors u have when u put pause thereHi al.. THANK you for responding.. i found out the cause.. i have to add set USER=myUserName for it to work.

Again, thanks for the help.



Discussion

No Comment Found