simple script

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
DEGO
Posts: 2
Joined: 17 Jul 2019 04:40

simple script

#1 Post by DEGO » 17 Jul 2019 04:47

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

aGerman
Expert
Posts: 3673
Joined: 22 Jan 2010 18:01
Location: Germany

Re: simple script

#2 Post by aGerman » 17 Jul 2019 15:45

Remove all spaces around the = in every SET statement.

Steffen

DEGO
Posts: 2
Joined: 17 Jul 2019 04:40

Re: simple script

#3 Post by DEGO » 19 Jul 2019 00:18

yes, now it works fine.

thanks.

Post Reply