K
K
kondrash0552016-04-01 11:00:27
System administration
kondrash055, 2016-04-01 11:00:27

Why does *.bat script not work correctly?

Good day.
There is a bat-nick like:

for /f "delims=" %%i in (C:\FilesFor1C\userlist.txt) do msg %%i "%~1"

which sends messages to terminal users. For some reason, not everyone gets messages, the username in the userlist.txt file is correct. There is a suspicion that after the first error the mailing does not go. How to make sure that errors are discarded and messages reach other users?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
res2001, 2016-04-01
@res2001

To check, add to the loop the output of the usernames to which messages are directed:
for /f "tokens=* delims=" %%i in (C:\FilesFor1C\userlist.txt) do (msg %%i "%~1" & echo .%%i)
I think that the problem here is rather in the work of msg, and not in your script.
And yet, check the encoding of the userlist.txt file and whether it contains Cyrillic usernames. For everything to work properly, the file encoding must match the batch file encoding.

O
Olgeir, 2016-04-01
@Olgeir

enable logging.
@echo off
set LOG=C:\FilesFor1C\userlist.log
for /f "delims=" %%i in (C:\FilesFor1C\userlist.txt) do msg "%%i" "%~1"&&(echo %date% %time% [%%i] Send>>"%LOG%")||(echo %date% %time% [%%i] NOT Send>>"%LOG%")

A
Arman, 2015-02-18
@Urukhayy

Well, list them in the same order

INSERT INTO `table` (`ID`, `City`, `Color`) 
SELECT `ID`, `City`, `Color`
FROM `users` WHERE `Name` = "Test"

// или если id не надо

INSERT INTO `table` (`ID`, `City`, `Color`) 
SELECT null, `City`, `Color`
FROM `users` WHERE `Name` = "Test"

A
Alexey Yakhnenko, 2015-02-18
@ayahnenko

dev.mysql.com/doc/refman/5.1/en/insert-select.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question