Installation problems root

No, you cal call C:\root-6.20.04-build\bin\thisroot.bat from anywhere…

but I have this problem too

I can’t use the “Call” function…it says the input line is so long…

Sorry, but I really don’t understand what you’re trying to do… Where is that batch script? Where do you call it from? Why do you need it at all?

You said me to compile the macro in other directory and that I can call the thisroot.bat anywhere…
but I can’t call it, because if I call it I get that error…

I still don’t understand. Go to the directory you want, call C:\root-6.20.04-build\bin\thisroot.bat, and then start root

For example:

**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.4.6
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'

C:\Users\bellenot>cd rootdev

C:\Users\bellenot\rootdev>C:\Users\bellenot\build\release\bin\thisroot.bat

C:\Users\bellenot\rootdev>root -l
root [0]

@bellenot Well, you said “call …”, he uses “Call …”. If you said “run …”, there would be “Run …”. If “execute …”, “Execute …”. And so on. :rofl:

More seriously speaking, the problem is that on Windows, in one’s own “.bat” file, one needs to use “call …thisroot.bat”, because the control must return to the calling batch file. So the “input file too long” is a real problem in this case (assuming that it really comes from this “call” command and not from the next “root -l” line).

1 Like

@bellenot and @Wile_E_Coyote yes…sorry reading

I thought that I had to write CALL in the bat file!

Yes, if you create a bat file (so called batch script), as I said, you have to use call C:\root-6.20.04-build\bin\thisroot.bat. But you still didn’t reply to my questions: Why do you need another batch script? Where is that batch script? Where do you call it from?

Yes, I agree, it’s why I try to understand where this error is coming from, hence my questions to @faca87

@bellenot If I write Call in the bath file, I get the error that the line is so long

About your questions…

When I open the Developer Prompt, the default directory is

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community

I wrote a bat file so that I don't have to write every time

> C:\root-6.20.04-build\bin\thisroot.bat

I mean…I want the bat file so that I Don’t need to write a long directory…
using the bat file I just write

root.bat
root -l

If the “call …thisroot.bat” is the very last command in your “root.bat” then you should not need to use “call” (just the full path to “…thisroot.bat”).

It’s completely unrelated. You can change the default directory. For example, you can set the default directory to %USERPROFILE%, as shown here:

That will make the default directory to your home directory (e.g. for me: C:\Users\bellenot)

And where did you put your batch script?

@Wile_E_Coyote indeed I’m currently use this bat file (now I decided to run in C:\root-6.20.04-build\macrorun)

cd C:\root-6.20.04-build\macrorun
C:\root-6.20.04-build\bin\thisroot.bat
root -l 

but the bat file doesn’t read the last command root -l so I’ve to write it by hand . Somedays ago, @bellenot said me to use

@echo off
call C:\root-6.20.04-build\bin\thisroot.bat
root -l

but I get the long line error…

@bellenot I didn’t know that I could change the defauld directory of the developer prompt!

Currently I have the bat file in C:\Program Files (x86)\Microsoft Visual Studio\2019\Community but, as you can read above, I also tried to move it…

Never do that! It might cause problems (see what I mean?) You can add any location to your PATH and put your batch script there. For example, add C:\root-6.20.04-build\bin\ in your PATH and simply type thisroot.bat from anywhere. And if you don’t know how to modify environment variables like PATH, google for it and learn a bit how to use Windows… :wink: :

Can it be that the last “root -l” line simply tries to execute the “root.bat” again?
Try to explicitly use “root.exe -l” or maybe “%ROOTSYS%\bin\root -l

@bellenot Thank you…then

  1. I moved my bat file in C:\root-6.20.04-build\macrorun
  2. I setted the path C:\root-6.20.04-build\macrorun
    so I call myroot.bat anywhere

@Wile_E_Coyote I don’t think so because

  1. I tried to rename the bat file to myroot.bat
  2. I wrote
 cd C:\root-6.20.04-build\macrorun
C:\root-6.20.04-build\bin\thisroot.bat
C:\root-6.20.04-build\bin\root -l

anyway that isnt’ a problem I will write

myoroot.bat
root -l

the important thing is that it works (now it is working using aclic after fixed the errors that you adviced)…

Note: inside of your “myroot.bat”, you still need “call ...thisroot.bat”.

1 Like

Hi @Wile_E_Coyote the problem is that if I write call in myroot.bat file, I get error for long input line…

I wrote the bat file as @bellenot wrote

but using call I get that error…I don’t know why…