BAT: if statement based on modify date of file

落爺英雄遲暮 提交于 2019-12-02 07:52:05
Bryan Field

As Wimmel suggested, I will be using VBScript - well actually I will be using JScript in the same way VBScript would normally be used... because I am already familiar with JavaScript.

I posted this question: Windows XP and Up: JavaScript instead of VBScript?

Which has the code I will be using

for checking modify date/time

var o = new ActiveXObject("Scripting.FileSystemObject");
var file = o.GetFile("c:\\temp\\test.js");
// WScript.Echo(file.DateLastModified); // This is the modify date/time with seconds

and code to exec my Java process

WshShell = WScript.CreateObject("WScript.Shell");
var result = WshShell.Run("command-goes-here", 0, true);
// WSH.Echo(result); // this is the exit code

command b will be to send the UDP packet using one of the suggestions from Windows BAT or CMD: send some data to a localhost udp port.

The commands would probably be the same if I used VBScript/JScript so they should work fine.

The only thing missing is: VBScript/JScript Networking: Connect either UDP or TCP

If I could use a native function, it would definitely be better than an exec of command b.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!