what cause this ott: ------ after run a script

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
goodywp
Posts: 265
Joined: 31 Jul 2017 09:57

what cause this ott: ------ after run a script

#1 Post by goodywp » 20 Nov 2017 15:35

Hi,

Anyone know what cause this happen?

When I ran a script and I got what I expected but at the beginning shows this as below, I can ignore but I would rather to know what was the cause....

>var2cfg.cmd (just after I ran this script, see code below) the following was displayed on the screen at the beginning
>ott:: -----------------------------------------------------------------------------------------
The filename, directory name, or volume label syntax is incorrect.

Code: Select all


@ECHO OFF
if exist srcfg.cmd (del srcfg.cmd)
rename varsrc11.txt srcfg.cmd
call srcfg.cmd  :: call C:\auto_pkg_build\Scripts\single_comp\srcfg.cmd

set VARSRC5=%VARSRC5: =%

if "%VARSRC5%" == "SL_customer" goto SL
if "%VARSRC5%" == "DL_customer" goto DL

:SL
 
if exist SL_customer.TXT (del SL_customer.TXT)
ECHO {>> SL_customer.TXT
ECHO 	"P3A": %VAR1%, >> SL_customer.TXT
ECHO 	"Packager": %VAR2%, >> SL_customer.TXT
ECHO 	"Scheme": %VAR3%, >> SL_customer.TXT
ECHO 	"SingleList": %VAR4%, >> SL_customer.TXT
ECHO 	"SingleRemove": %VAR5%, >> SL_customer.TXT
ECHO 	"ExtraList": %VAR7% >> SL_customer.TXT
ECHO }>> SL_customer.TXT

if exist replacesingle.cfg (del replacesingle.cfg)
rename SL_customer.TXT replacesingle.cfg
copy replacesingle.cfg C:\auto_pkg_build\Tools\PACKAGER\
goto end

:DL
if exist DL_customer.TXT (del DL_customer.TXT)
ECHO {>> DL_customer.TXT
ECHO 	"P3A": %VAR1%, >> DL_customer.TXT
ECHO 	"Packager": %VAR2%, >> DL_customer.TXT
ECHO 	"Scheme": %VAR3%, >> DL_customer.TXT
ECHO 	"SingleList": %VAR4%, >> DL_customer.TXT
ECHO 	"SingleRemove": %VAR6%, >> DL_customer.TXT
ECHO 	"ExtraList": %VAR7% >> DL_customer.TXT
ECHO }>> DL_customer.TXT

if exist replacedouble.cfg (del replacedouble.cfg)
rename DL_customer.TXT replacedouble.cfg
copy replacedouble.cfg C:\auto_pkg_build\Tools\PACKAGER\
goto end

:end

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

Re: what cause this ott: ------ after run a script

#2 Post by Squashman » 20 Nov 2017 15:45

What is in srcfg.cmd?

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

Re: what cause this ott: ------ after run a script

#3 Post by Squashman » 20 Nov 2017 16:04

Just a little advice on troubleshooting your batch files.

1) Run from the cmd prompt.
2) Use ECHO ON so that you can see each line of code execute. Then you should be able to see exactly what line of code is causing the error or output.

ShadowThief
Expert
Posts: 1166
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: what cause this ott: ------ after run a script

#4 Post by ShadowThief » 23 Nov 2017 05:49

The problem definitely lies in srcfg.cmd, but without seeing that code it's impossible to say what the exact problem is. My guess is that it's not saved as ANSI or something.

goodywp
Posts: 265
Joined: 31 Jul 2017 09:57

Re: what cause this ott: ------ after run a script

#5 Post by goodywp » 27 Nov 2017 14:55

Thanks! you are right it was from srcfg.cmd.

I redo the job and works fine now....

Post Reply