Page 1 of 1

simple script

Posted: 17 Jul 2019 04:47
by DEGO
hi all,

I have this script that is very easy:

Code: Select all

::
::@echo off

::
cls

::
set instance    = %1
set database    = %2

::
set log_extension       = log
set setup_log_path      = %CD%\%database%
set setup_log_name      = %~n0.%log_extension%
set setup_log_file_path = %setup_log_path%\%setup_log_name%
the ouput is :

C:\Users\ce168diedifi\Desktop\prova-installer>set instance = myinstance <-- correct

C:\Users\ce168diedifi\Desktop\prova-installer>set database = mydb <-- correct

C:\Users\ce168diedifi\Desktop\prova-installer>set log_extension = log <-- correct

C:\Users\ce168diedifi\Desktop\prova-installer>set setup_log_path = C:\Users\ce168diedifi\Desktop\prova-installer\ <-- why the result is not the concatenation?

C:\Users\ce168diedifi\Desktop\prova-installer>set setup_log_name = Setup. <-- why the result is not the concatenation?

C:\Users\ce168diedifi\Desktop\prova-installer>set setup_log_file_path = \ <-- why the result is not the concatenation?

Please help me.

Diego

Re: simple script

Posted: 17 Jul 2019 15:45
by aGerman
Remove all spaces around the = in every SET statement.

Steffen

Re: simple script

Posted: 19 Jul 2019 00:18
by DEGO
yes, now it works fine.

thanks.