Batch Script to check file size & send email -


i new scripting. looking script through can know particular file size on remote machine & send email me accordingly on daily basis please let me know in step step.

batch parses entire command, if it's spread across multiple lines, before executing it. part of procedure, substitutes %var% variable value var has @ time parsed - is, before executed.

size not set before if... parsed, value replaced (nothing) , hence command interpreted if (nothing) gtr 0

further, single-quotes around filename change filename dince ' valid filename character.

number of cures: easiest seems be

if exist %v_tmp_file% ( %%a in (%v_tmp_file%) ( if %%~za gtr %minbytesize% (     %v_email_path%\postie -host:internalmail.usa.xl -to:"%v_to_email_id%" -from:%computername%@xlgroup.com -s:"%v_src_table_nm% %v_subj%" -msg:"%v_msg%"  ) else (     echo %v_tmp_file% empty ) 

Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -