TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Yogesh Vedpathak
678
1.4k
191.2k
print echo (msg) using conditional if else using batch scrip
Jun 14 2018 6:17 AM
when we put filename which is avaliable into (X:\) dir into filename.text file then file is copied to
E:\XbdArchive\ this location
requirement is : when if file is copied to to that location i want print message file sending sucessful and if fail then print message fail ...
Thanks in advance
ECHO OFF
FOR /F "tokens=1,2* delims=," %%G IN (\\Path\Missed_R\filenames.txt) DO (
ECHO ON
ECHO %%G
ECHO OFF
IF %%G==NUL goto:eof
copy X:\%%G.old E:\XbdArchive\
CD D:\SAP_X3\NDATA
REN *.old *.txt
ECHO ON
ECHO %%G
)
@echo off
// quote the path or else it won't work if there are spaces in the path
SET LOCATION_PATH="E:\XbdArchive\";
if exist %LOCATION_PATH% (
echo File Sending sucessful;
)
else if
SET LOCATION_PATH="E:\XbdArchive\";
if not exist % LOCATION_PATH% (
echo File Sending not sucessful;
)
pause
copy NUL \\Path\Missed_R\filenames.txt
Reply
Answers (
2
)
How to make free https ?
Index was out of range. Must be non-negative and less than t