Page 1 of 2
batch file doesnt work anymore
Posted: 18 Jul 2012 00:31
by rjobaan
the same batch file i use in
http://www.dostips.com/forum/viewtopic.php?f=3&t=3534 does not work anymore.
In the beginning i was just running the batch file on my PC, and i added the to applications path to my environment variables PATH.
Now i try to run the same batch on a shared folder, and i added to extra variables for the location of the application.
I put those application just in a folder.
Even this code does not work anymore?
Code: Select all
@echo off
cls
Color 0E
Title PDF Merging Batch
:: Any Changes Happen Here >>
set "app_jpdf=S:\Production\Temp\Applications\jpdfbookmarks"
set "app_pdftk=S:\Production\Temp\Applications\pdftk\bin"
set "folder=S:\Production\Temp\Basic reports"
set "bookmark=S:\Production\Temp\Bookmarks"
set "bk_list=fullbookmarks.txt"
set "file_1=Report 1.pdf"
set "file_2=Report 2.pdf"
set "file_3=Report 3.pdf"
::Bookmarks maken van de pdf bestanden >>
%app_jpdf%\jpdfbookmarks_cli.exe --dump "%folder%\%file_1%" > "%bookmark%\bookmarks1.txt"
%app_jpdf%\jpdfbookmarks_cli.exe --dump "%folder%\%file_2%" > "%bookmark%\bookmarks2.txt"
%app_jpdf%\jpdfbookmarks_cli.exe --dump "%folder%\%file_3%" > "%bookmark%\bookmarks3.txt"
pause
I am getting the following errro message:
18 juli 2012 8:28:06 java.util.prefs.Windows.preference <init>
WARNING:Could not open/create prefs root node Software\javasoft\prefs at root 0x8000002. Windows RegCreateKeyEx <..>
returned error code 5.
Re: batch file doesnt work anymore
Posted: 18 Jul 2012 05:50
by Squashman
So you added a folder to your PATH variable and your batch file stopped working. Might help if we saw the output from the PATH variable.
Could you also please use CODE tags around your code.
Re: batch file doesnt work anymore
Posted: 18 Jul 2012 06:48
by rjobaan
i just added
Code: Select all
PATH S:\Production\Temp\Applications\jpdfbookmarks
And i saw when using command PATH that path is fine
so i think is a right issue.
Re: batch file doesnt work anymore
Posted: 18 Jul 2012 09:18
by foxidrive
You have disabled all of the original path variable.
Try this:
Code: Select all
SET PATH=%path%;S:\Production\Temp\Applications\jpdfbookmarks
Re: batch file doesnt work anymore
Posted: 18 Jul 2012 10:55
by rjobaan
My pATH is still fine, its has to do with the security. Its not allowed to run java what is used by jpdfbookmarks.
Re: batch file doesnt work anymore
Posted: 18 Jul 2012 12:15
by foxidrive
rjobaan wrote:My pATH is still fine, its has to do with the security. Its not allowed to run java what is used by jpdfbookmarks.
Your path is not fine. You disabled every command in the system32 folder
including CMD.EXE!
Re: batch file doesnt work anymore
Posted: 18 Jul 2012 12:18
by Squashman
foxidrive wrote:rjobaan wrote:My pATH is still fine, its has to do with the security. Its not allowed to run java what is used by jpdfbookmarks.
Your path is not fine. You disabled every command in the system32 folder.
Exactly. I don't know why people fight you when you ask for such basic information.
If we are wrong then we are wrong but I like proof that something I ask for is the way it is suppose to be.
So yes, if the PATH variable is just that one directory then it is wrong.
So please just placate us and show us the output of this command from the command prompt.
Or
Re: batch file doesnt work anymore
Posted: 18 Jul 2012 12:24
by rjobaan
fighting?
im not fighting anybody.
Im trying to explain that my path is still fine
path
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShel l\v1.0\;C:\Program Files\jpdfbookmarks;
Its has to due with my rights on my environment is was working on.
If you want you can close this topic
how can i post screenshot?
Edit PATH above. I copied from the environmental variables, and a replaced by hand the %SYSTEM ROOT%, that cause the ; to be missed
Re: batch file doesnt work anymore
Posted: 18 Jul 2012 12:26
by Squashman
rjobaan wrote:fighting?
im not fighting anybody.
Im trying to explain that my path is still fine
PATH= C:WINDOWS\system32;C:WINDOWSC:WINDOWS\System32\Wbem;C:WINDOWS\System32\WindowsPowerShel l\v1.0\;C:\Program Files\jpdfbookmarks;
Its has to due with my rights on my environment is was working on.
I don't believe anything until I have hard evidence. Same reason I have issues believing in a higher power.
How can you say your path is fine when it is missing a semicolon!
Re: batch file doesnt work anymore
Posted: 18 Jul 2012 12:35
by foxidrive
rjobaan wrote:fighting?
im not fighting anybody.
Im trying to explain that my path is still fine
PATH= C:WINDOWS\system32;C:WINDOWSC:WINDOWS\System32\Wbem;C:WINDOWS\System32\WindowsPowerShel l\v1.0\;C:\Program Files\jpdfbookmarks;
This is what you said you had. Now run the batch file and look at what the path is. You say you aren't fighting, but you're telling lies somewhere along the line.
Code: Select all
@echo off
PATH S:\Production\Temp\Applications\jpdfbookmarks
echo %path%
pause
Re: batch file doesnt work anymore
Posted: 18 Jul 2012 12:38
by foxidrive
Squashman wrote:rjobaan wrote:fighting?
Im trying to explain that my path is still fine
PATH= C:WINDOWS\system32;C:WINDOWSC:WINDOWS\System32\Wbem;C:WINDOWS\System32\WindowsPowerShel l\v1.0\;C:\Program Files\jpdfbookmarks;
How can you say your path is fine when it is missing a semicolon!
His powershell is not valid either because it has a space between two ll's
Re: batch file doesnt work anymore
Posted: 18 Jul 2012 12:51
by rjobaan
Im not lying, why should i do that?
Let me explain:
I told you I added PATH S:\Production\Temp\Applications\jpdfbookmarks
Normally this will indeed disable all of the original path variable, but after that i did an Echo %Path%, it it still showed the default path.
That's why i told you my path is still fine, because the statement did not work.
I think its just a miscommunication, probably from me side because now i understand why you are saying my path variable is wrong.
No hard feelings right?
Re: batch file doesnt work anymore
Posted: 18 Jul 2012 12:55
by rjobaan
foxidrive wrote:
His powershell is not valid either because it has a space between two ll's
You are right, i will ask administrator to change that
Re: batch file doesnt work anymore
Posted: 18 Jul 2012 13:20
by Squashman
rjobaan wrote:foxidrive wrote:
His powershell is not valid either because it has a space between two ll's
You are right, i will ask administrator to change that
Why would you need your admin to change it. You already said you added C:\Program Files\jpdfbookmarks to your path.
Re: batch file doesnt work anymore
Posted: 18 Jul 2012 13:26
by foxidrive
rjobaan wrote:Let me explain:
I told you I added PATH S:\Production\Temp\Applications\jpdfbookmarks
Normally this will indeed disable all of the original path variable, but after that i did an Echo %Path%, it it still showed the default path.
There is no normally about it. It will break the batch file it is running in.
If you typed echo %path% then it showed the path from the master environment and not the environment that the batch file was running in.
Your knowledge is very limited, hence you argued and decided that your path was fine.