batch file doesnt work anymore

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
rjobaan
Posts: 30
Joined: 14 Jul 2012 11:16

batch file doesnt work anymore

#1 Post by rjobaan » 18 Jul 2012 00:31

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.
Last edited by rjobaan on 18 Jul 2012 06:40, edited 1 time in total.

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: batch file doesnt work anymore

#2 Post by Squashman » 18 Jul 2012 05:50

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.

Code: Select all

set path

Could you also please use CODE tags around your code.

rjobaan
Posts: 30
Joined: 14 Jul 2012 11:16

Re: batch file doesnt work anymore

#3 Post by rjobaan » 18 Jul 2012 06:48

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.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: batch file doesnt work anymore

#4 Post by foxidrive » 18 Jul 2012 09:18

You have disabled all of the original path variable.

Try this:

Code: Select all

SET PATH=%path%;S:\Production\Temp\Applications\jpdfbookmarks

rjobaan
Posts: 30
Joined: 14 Jul 2012 11:16

Re: batch file doesnt work anymore

#5 Post by rjobaan » 18 Jul 2012 10:55

My pATH is still fine, its has to do with the security. Its not allowed to run java what is used by jpdfbookmarks.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: batch file doesnt work anymore

#6 Post by foxidrive » 18 Jul 2012 12:15

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!
Last edited by foxidrive on 18 Jul 2012 12:18, edited 1 time in total.

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: batch file doesnt work anymore

#7 Post by Squashman » 18 Jul 2012 12:18

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.

Code: Select all

set path

Or

Code: Select all

echo %path%

rjobaan
Posts: 30
Joined: 14 Jul 2012 11:16

Re: batch file doesnt work anymore

#8 Post by rjobaan » 18 Jul 2012 12:24

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
Last edited by rjobaan on 18 Jul 2012 12:34, edited 2 times in total.

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: batch file doesnt work anymore

#9 Post by Squashman » 18 Jul 2012 12:26

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!

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: batch file doesnt work anymore

#10 Post by foxidrive » 18 Jul 2012 12:35

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

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: batch file doesnt work anymore

#11 Post by foxidrive » 18 Jul 2012 12:38

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

rjobaan
Posts: 30
Joined: 14 Jul 2012 11:16

Re: batch file doesnt work anymore

#12 Post by rjobaan » 18 Jul 2012 12:51

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?

rjobaan
Posts: 30
Joined: 14 Jul 2012 11:16

Re: batch file doesnt work anymore

#13 Post by rjobaan » 18 Jul 2012 12:55

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

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: batch file doesnt work anymore

#14 Post by Squashman » 18 Jul 2012 13:20

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.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: batch file doesnt work anymore

#15 Post by foxidrive » 18 Jul 2012 13:26

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.

Post Reply