A good starting place is the print documentation that came with Windows NT and on the Windows NT CD in the support\books directory. Windows Help files are also available.
You can get some in-depth information on Windows NT from the Windows NT Resource Kit, available at bookstores and from Microsoft. Microsoft TechNet is also a valuable resource.
World Wide Web support for Windows NT Server is at:
http://www.microsoft.com/ntserver/
Support for Windows NT Workstation is at:
http://www.microsoft.com/ntworkstation/
Print documentation comes with Windows 95, as well as some
documentation on the CD-ROM. Help files are available from the
Start menu.
The Windows 95 Resource Kit contains in-depth information on
Windows 95. It's available at bookstores and software stores.
World Wide Web support for Windows 95 is at:
http://www.microsoft.com/windows95/
Unfortunately, Win32 platforms don't provide the shebang syntax, or
anything like it. You can try one of the two following methods to
run a script from the command line. If all else fails, you can
always just call the perl interpreter directly ("perl myscript.pl").
For Windows NT 4.0, the coolest method is to use associated file
types (see question 4.10). If you've associated Perl scripts with
the .pl extension, you can just type the name of your file at the
command line and Windows NT will launch perl.exe for you. If you
change the PATHEXT environment variable to include .pl files, like
this:
you can just type the file name without an extension, and Windows NT
will find the "closest" .pl file with that name. You may want to set
PATHEXT in the System control panel applet rather than on the command
line. Otherwise, you'll have to re-enter it each time the command
prompt window closes.
Given this setup, you can have a Perl script called cat.pl that looks
like this:
and you can invoke it on the command line like this:
However, you can't invoke it with I/O redirection, like this:
although it looks like you should be able to. Your script can
be in your path or you can provide a path to the file.
Note that this method does not work for Windows 95, nor does it work with
Windows NT if you have command extensions disabled. You can, however,
still start the Perl script from an Explorer window if the extension is
associated with perl.
Another option is to use the pl2bat utility distributed with Perl for
Win32 to "convert" your Perl script into a batch file. What this
does is tag some Win32 batch language to the front of your script so
that the system calls the perl interpreter on the file. It's quite a
clever piece of batch coding, actually.
If you call the pl2bat utility on your Perl script "helloworld.pl", like
this:
it will produce a batch file, "helloworld.bat". You can then invoke the
script just like this:
(or whatever). You can pass command line parameters pretty easily.
Your script can be in your PATH, or in another directory, and the pl2bat
code will usually find it and execute it correctly. Like with file
associations, however, you can't use I/O redirection.
pl2bat invokes perl.exe with the -w switch. If you don't like having the
warning messages come up, and you know they're not important, you have
to go in to the batch file and take the -w out yourself.
There is no direct equivalent of the chmod tool on Win32 systems. For
file attributes, you can use the ATTRIB command line tool (type HELP
ATTRIB at the command line for details). For more complex permissions,
see question 4.9.
For information on the chmod function, question 5.9.
Neither Windows 95 and Windows NT ships with a command-line SMTP client
like "sendmail" in UNIX. Several exist, however. One popular one is
BLAT, which is available in the Windows NT Resource Kit, and on the Web
at this URL:
http://gepasi.dbs.aber.ac.uk/softw/Blat.html
Note that the command line syntax for BLAT is different from of "sendmail".
Microsoft has a port of sendmail available on their FTP site at:
ftp://ftp.microsoft.com/developr/drg/unix-to-windows/ports/sendmail/
A commercial sendmail product is available from MetaInfo, Inc., at:
There is an evaluation version available for download.
Another commercial mail product is wrmail, part of the slmail product
from Seattle Labs. A free version is available at
A Perl script for sending mail without using an external program is also
available on Robin Chatterjee's Perl for Win32 page (see question 3.4).
The UNIX tool 'cron' doesn't exist on Win32 platforms.
For Windows NT, a scheduling tool called AT is available
[pronounced "@" -ESP]. AT doesn't use a table file, but takes
command-line arguments. Note that the Schedule service must be running
when your job is supposed to happen.
If you don't like the command-line version of AT, there's a GUI version,
WinAT available with the Windows NT Resource Kit.
A commercial cron-like scheduler, NTcrond, is available from #ifdef
software (http://www.ifdef.com/).
For Windows 95, there's a System Agent available with the Microsoft
Plus! Pack. Also, there are several shareware scheduling
utilities, notably LaunchPad and Metz Scheduler. These can be found
on a good shareware search engine (like http://www.shareware.com/).
You might want to take a look at the help file for Windows NT and
Windows 95 commands to see if there's a rough equivalent distributed
with your Win32 platform. If not, and your question isn't answered
above, try one of these UNIX-on-Win32 packages:
There are also several UNIXy tools available in the Windows NT
Resource Kit. Finally, there are several UNIX-to-Win32 commercial
packages available, including the MKS Toolkit from Mortice Kerns
Systems, Inc. (http://www.mks.com/).
For general UNIX-on-NT information, see the UNIX to NT Resource Center
(http://www.nentug.org/unix-to-nt/). [Any others? -ESP]
On Windows NT, a service is a special kind of executable program that
runs in the background. Services are used for programs that are constantly
working, such as network protocols or database servers. Most WWW servers
on Windows NT are implemented as services.
A service is different from other programs in several ways:
The most important thing to remember is that you have to take special
steps to make resources available to services. In general, you
need to make files available to the Everyone group, and you have to
have environment variables (like PATH) be system environment variables.
[Some readers have pointed out that you can in fact run a service from
the command line, using the "net start" command. True, but it's a lot
different than running other programs from the command line -- type
"net start /?" to find out how to use this command. -ESP]
Win32 platforms don't have the same mechanisms for setting permissions
on files as UNIX does. For files on FAT partitions (which means all files
in Windows 95), you don't have to set permissions explicitly on a file.
All files are available to all users.
For files on an NTFS partition on Windows NT, you can set the security
permissions on a file using the Explorer and the properties sheet of the
file. Right-click on the file in Explorer, and select the Properties
item on the drop-down menu. Select the Security tab, and press the
Permissions button to set the Permissions on the file. Click Help for
more information.
4.2. Where can I get general information on Windows 95?
4.3. What's the equivalent of the shebang ("#!") syntax for Win32?
SET PATHEXT=.pl;%PATHEXT%
while ( <> )
{
print;
}
cat myfile.txt
cat < myfile.txt
cat myfile.txt | more
C:> pl2bat helloworld.pl
C:> helloworld
Hello, World!
4.4. What's the equivalent of chmod for Win32?
4.5. What's the equivalent of sendmail for Win32?
4.6. How do I schedule jobs on Win32 platforms?
4.7. I need UNIX tool X. Where is it?
4.8. What is a Windows NT service?
4.9. How do I set permissions on a file?