batch files, vb scripts, kixtart - fill me in

I’m a fairly knowledgeable network manager (Microsoft), but have no real programming background. I know that batch files end in .bat and vbs scripts end in .vbs, but what is the real difference in their use? I have heard also good things about Kixtart – how does that fit in?

I’ve looked around the internet for sites relating to scripting and batch files for system administrators, but I haven’t found any that provide a good basic tutorial for new programmers. Is it necessary to learn some level of programming first?

Either way, I’d be interested in sites giving me basic knowledge in scripting and/or the programming knowledge necessary to give me that boost.

Both BAT files and VBS scripts can be used to automate system administration tasks - backing up files, clearing log files, pretty much anything you could do interactively.

BAT files are ancient and date from the days of DOS. They are run by the cmd.exe command processor, which has a limited vocabulary - basically all it can do is things like test if a file exists, check a simple condition and GOTO a specific line, etc. Until a couple of years ago, though, BAT files were the only simple way to automate things in Windows (not counting Macro Recorder which I never really used). A BAT file is essentially a list of DOS commands with elementary flow control.

On the other hand, VBS files are a more recent addition to Windows - perhaps in response to powerful Shell Scripts that have always existed in UN*X.

VBS scripts also allow you to automate tasks in Windows. In this case the language used is the much more powerful VBScript - this gives you access to the full Windows object model. VBScript takes a little more effort to learn, but is way more versatile than BAT files.

You can also write scripts for other scripting engines - e.g. I believe the WSH (Windows Scripting Host) also understands .js files (JavaScript).

I’ve never used Kixtart but then I’m a developer, not a sys admin.

Here’s a link to Microsoft’s home page on Scripting - from there you can find links to download the latest WSH and for documentating on scripting in general.

Kickstart is the ROM code that you need in order to boot up your Amiga.

Another great site for WSH reference is:

http://www.devguru.com/Technologies/wsh/quickref/wsh_intro.html

Er, right you are AHunter3, but we’re talking about Kixtart. It’s an enhanced version of the command processor, aka command.com in the bad old DOS days. It comes with a lot of little extras like determining the version and datetimestamp of files to see if it should overwrite or not, wait for a specified time, writing and deleting from the registry, enhanced branching syntax and a host of others. Try www.kixtart.org. It looks like it’s free to download and use. Command reference is here. VBScript may be the way to go if you know neither type of programming already. We use Kixtart at my company and it does what we need it to. Kixtart script files end in .kix.

Bah, here’s the correct link to www.kixstart.org. And here’s a good place to get DOS batch programming instructions.

I might add that Kixtart requires its executable be pushed out to the client before that workstation can process a .kix script. This is easily done with a DOS batch file first that uses a simple IF EXIST statement to see if the executable is already there, then makes a call to the kixtart processor to continue with the .kix script. Another minor note to make is the command line processor for Windows NT based machines is cmd.exe.

One of the tricky things about DOS batches is that WindowsNT may react differently to commands (such as START and NET USE) than Win9x machines. Kixtart does not have this problem since the same executable is used on both.

And here’s a good place to get DOS batch programming instructions.

:smack: :smack:

I’ve been to this site before, but while I’m sure there’s a lot of helpful information, it’s not very clear where a beginner should start.

I work for a large investment bank and our login script went from a .bat file to Kixtart, and now we’re moving to VBS.

Kixtart was nice, certainly better than batch files, but it wasn’t offering us anything over VBS and we had a couple of version issues with kix32.exe [login scripts were failing for some clients]. My advice is to put your effort into learning VBS. I use Perl for most of my scripting, but I think VBS is easier to learn.

Shoulda put the winkie smilie on that post.

Incidentally, regarding batch files, is there anyway to redirect the output to the clipboard, so that the next “paste” operation in any program will insert the results of the batch command(s)?

Yeah, I know the library of DOS commands on the PC predated the common shared Microsoft clipboard, but perhaps they were updated & retrofitted somewhere along the line so as to be able to speak to one another?

Microsoft produces a utility ‘clip.exe’ to handle the clipboard form the command line - see ftp://ftp.microsoft.com/Services/TechNet/samples/ps/win98/reskit/file/ and select “clip.exe”. clip /? for help.

Thanks!

I can’t use that for my immediate purposes (looking for ways of trapping the IP address of FileMaker users without installing any program on their machines they don’t already have; I can run batch commands from within FileMaker but to trap the results in an FmPro record I need to grab the output after running the batch command. Was hoping to “print to clipboard” and then paste in field and parse out the IP address).

But I will almost certainly find it useful for other deployments :slight_smile: