Updating DOS Batch Files for Windows

Has anyone had any recent programming requirements for automatic DOS Batch tasks in a Windows window?

I have automation, and I would prefer not to sit and write a bunch of .BAT files in Notepad if there is a better way to automate these tasks: basically moving files at specific times and times, as well as starting Windows applications before and after moving files .

I think along the lines of the IDE, in which all DOS commands are available for the editor with the correct check of the syntax of the parameters. Is there anything like that, or should I solve this problem with something other than .BAT files?

+6
windows dos batch-file automation
source share
10 answers

For simple Windows automation beyond BAT VBScript and Powershell files, it might be worth a look. If you're curious about where to start again, VBScript + Windows Task Scheduler will be the first place I start. Copying a file using VBS can be as simple as:

Dim objFSO Set objFSO = CreateObject ("Scripting.FileSystemObject") If objFSO.FileExists("C:\source\your_file.txt") Then objFSO.CopyFile "C:\source\your_file.txt", "C:\destination\your_file.txt" EndIf 
+6
source share

Definitely PowerShell . This is a new Microsoft shell with many interesting features and great extensibility.

+4
source share

Try Python.

+3
source share

Windows 98SE and higher have a Windows Script built-in host that allows you to use VBScript to automate tasks (see, for example, http://www.windowsdevcenter.com/pub/a/oreilly/windows/news/vbscriptpr_0201.html ).

+2
source share

I use AutoIt for this because PowerShell is not available by default on all machines. AutoIt offers a simple language with lots of default code that you can reuse. AutoIt can compile to .exe.

I’m not sure that there is a "Moving files in a certain state", but I once wrote a Robocopy Controller script (using AutoIt) through which you can install a copy of the script that will be filled on Robocopy.exe (a "reliable copy of the file" is a copy program , which can be downloaded from Microsoft and is included by default in Windows Vista to replace xcopy). Perhaps this free script may help.

+2
source share

I would recommend Python over Ruby as a Windows scripting language. Python Windows support is much more mature than Ruby's.

+1
source share

I personally use Python or PowerShell for such tasks.

+1
source share

Here is the Powershell environment:

Powergui

+1
source share

vbscript / WSH is what Microsoft wants you to use - unfortunately, I wrote a few of them, and this is not nice -

I completely agree with Mikael - if you know which systems will run the scripts and you can install interpreters on them, go to a scripting language like Python or Ruby

Of course, it depends on what type of automation you need to do - if you mess with OS or Active Directory settings, go with WSH, but for your average file contents use Python or Ruby

0
source share

Although this is not exactly what you are looking for, I would choose Perl. Without a graphical interface, Perl will allow you to quickly complete your task, and the β€œglue” functions will be useful in future tasks that you may have. In addition, if one day you have to do such things under a different OS (it is not Windows), PowerShell may not be available, and your knowledge of Perl will come in handy.

In addition, Perl’s closest brother under Windows is certainly PowerShell.

0
source share

All Articles