<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to dkwt manual</title><link>https://sourceforge.net/p/dktools/wiki/dkwt%2520manual/</link><description>Recent changes to dkwt manual</description><atom:link href="https://sourceforge.net/p/dktools/wiki/dkwt%20manual/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 21 Dec 2023 18:58:32 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/dktools/wiki/dkwt%20manual/feed" rel="self" type="application/rss+xml"/><item><title>dkwt manual modified by Dirk Krause</title><link>https://sourceforge.net/p/dktools/wiki/dkwt%2520manual/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -3,7 +3,6 @@
 
 &lt;a href="../dkwt/" title="dkwt — List Windows users, groups, printers…"&gt;← Previous&lt;/a&gt;
 &lt;a href="../Home/" title="Home"&gt;↑ Home&lt;/a&gt;
-&lt;a href="../Home/#programs" title="Programs list"&gt;↑ Programs&lt;/a&gt;
 &lt;a href="../winprint/" title="winprint — Schedule file to Windows print queue"&gt;→ Next&lt;/a&gt;
 
 
@@ -319,7 +318,6 @@
 
 &lt;a href="../dkwt/" title="dkwt — List Windows users, groups, printers…"&gt;← Previous&lt;/a&gt;
 &lt;a href="../Home/" title="Home"&gt;↑ Home&lt;/a&gt;
-&lt;a href="../Home/#programs" title="Programs list"&gt;↑ Programs&lt;/a&gt;
 &lt;a href="../winprint/" title="winprint — Schedule file to Windows print queue"&gt;→ Next&lt;/a&gt;
 
 
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dirk Krause</dc:creator><pubDate>Thu, 21 Dec 2023 18:58:32 -0000</pubDate><guid>https://sourceforge.netade060ad4292d625c00cba0de7453ad106e8586f</guid></item><item><title>dkwt manual modified by Dirk Krause</title><link>https://sourceforge.net/p/dktools/wiki/dkwt%2520manual/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,2 +1,326 @@
-
-
+
+
+
+
+
+
+
+
+
+&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: left;"&gt;&lt;a href="../dkwt/" title="dkwt — List Windows users, groups, printers…"&gt;← Previous&lt;/a&gt;&lt;/td&gt;&lt;td style="text-align: center;"&gt;&lt;a href="../Home/" title="Home"&gt;↑ Home&lt;/a&gt;&lt;/td&gt;&lt;td style="text-align: center;"&gt;&lt;a href="../Home/#programs" title="Programs list"&gt;↑ Programs&lt;/a&gt;&lt;/td&gt;&lt;td style="text-align: right;"&gt;&lt;a href="../winprint/" title="winprint — Schedule file to Windows print queue"&gt;→ Next&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
+
+#  dkwt — List Windows users, groups, printers…
+
+
+[TOC]
+
+&lt;a id="synopsis" name="synopsis"&gt;&lt;/a&gt;
+## Synopsis
+
+~~~
+dkwt _command_ [_options_]
+~~~
+
+---
+
+&lt;a id="description" name="description"&gt;&lt;/a&gt;
+## Description
+
+The dkwt / dkwtadm program has the following functionality
+
+* List local users
+* List local groups
+* List local printers
+* Schedule print job file to Windows print queue
+* Modify environment variables.
+
+For classroom PCs the programs can perform cleanup operations on machine boot and user login.
+
+The dkwtadm.exe program is the same as dkwt.exe except it has a built-in manifest to ask for administrator permissions at startup.
+
+---
+
+&lt;a id="options" name="options"&gt;&lt;/a&gt;
+## Options
+
+Command|Option|Purpose
+-------|------|-------
+users||Show users.
+|-l|Long (detailed) output.
+|-s|Short output. Options -l and -s are mutually exclusive.
+groups||Show groups.
+|-l|Long (detailed) output.
+|-s|Short output. Options -l and -s are mutually exclusive.
+printers||Show print queues.
+|-l|Long (detailed) output.
+env||Modify environment.
+|-s|Modify system environment. The default is to modify the current users environment.&lt;br/&gt;Administrative privileges are required to modify the system environment.
+|-e|Use REG_EXPAND_SZ type when creating new registry values. This option is ignored when modifying existing registry values.
+|-u _name_|Unset variable by deleting the registry value specified by name.
+|-i _name_ _value_|Insert, make sure the named variable contains file/directory value. Insert at start of registry value if the path is not yet listed.
+|-a _name_ _value_|Append, make sure the named variable contains file/directory value. Append at end of registry value if the path is not yet listed.
+|-d _name_ _value_|Delete the file/directory specified as value from the variable. If the variable is empty after removal, remove the registry entry.
+boot||Cleanup up during machine boot process, requires dkwt.conf configuration file.
+|-t|Test mode, do not perform cleanup actions, just show what to do.
+login||Cleanup and preparations on user login, requires dkwt.conf configuration file.
+|-t|Test mode, do not perform cleanup actions, just show what to do.
+logout||Cleanup on user logout, requires dkwt.conf configuration file.
+|-t|Test mode, do not perform cleanup actions, just show what to do.
+shutdown||Cleanup on machine shutdown process, requires dkwt.conf configuration file.
+|-t|Test mode, do not perform cleanup actions, just show what to do.
+cleanup‑profiles&lt;br/&gt;clp||Manually clean up profile directories.
+keep||Temporarily disable cleanup until after next user login.
+unkeep||Resume normal cleanup operation.
+
+---
+
+## Classroom features (automatic cleanup)
+
+###    Classroom situation
+
+For PCs in a classroom we can make the following assumptions:
+
+* User accounts and groups are managed centrally, using Windows domain, AD or any other mechanism.&lt;br/&gt;There are no normal user accounts locally on the PCs, only the administrator account and some accounts predefined by Windows or other software (i.e. service accounts for anti-virus updates…).&lt;br/&gt; 
+* A file server is available, each user has a home directory on the server.&lt;br/&gt;Users save valuable data into that home directory on the file server.&lt;br/&gt; 
+* Typically all users in a PC classroom log in and out at the same time (start and end of a lecture).
+
+We do not want to store user profiles on the server for the following reasons:
+
+* From a lecturer's point of view the largest part of the user profile has nothing to do with the lectures. Storing complete user profiles on the server would waste TBs for web browser cache…&lt;br/&gt;Although there is a blacklist mechanism to exclude subdirectories from profile synchronization we don't want to use that. Maintaining a blacklist means never-ending trouble.&lt;br/&gt; 
+* The simultaneous login and logout of many users would generate load peaks on the server significantly higher than average load.
+
+So we decide to use the following policies for data storage:
+
+* In the group policies we allow local user profiles only. Profile synchronization to server is disabled.&lt;br/&gt; 
+* During the lectures users work with data either in a public directory (i.e. c:\user or c:\temp or c:\lecture) or in their user profile.&lt;br/&gt; 
+* At the end of the lecture valuable data from public directories or user profile is moved to the home directory on the server or to personal media (i.e. USB stick or portable hard disk).&lt;br/&gt;This might seem inconvenient at first but ensures users learn one of the most important things for each software: Where is my data stored?&lt;br/&gt; 
+* Users are encouraged to remove any file they created on the local hard disk (after saving it, of cause) before leaving the computer.
+
+###    Cleanup on Windows Vista and above
+
+The account running the boot, logon, logoff and shutdown scripts on Windows Vista and above does not have sufficient privileges to delete user profile directories. That's technical progress.
+Additionally the directory structure in user profiles is … There are symbolic links to parent and/or child directories, even programs shipped with Windows have problems to handle that. I.e. when using icacls.exe on a user profile there are problems with "infinite" loops finished by buffer size restrictions or invalid handle conditions.
+
+So we do not apply any changes to user profiles from boot, logon, logoff or shutdown scripts, we just clean up the public directories.
+
+In regular intervals someone needs to log in as administrator and run
+
+~~~
+dkwtadm cleanup-profiles
+~~~
+
+###    Cleanup on Windows XP
+
+
+During user logout we use the logoff script to change permissions to public directories and the user profile: Full access is granted to the System user and to the Everyone role.
+The dkwt.exe program runs icacls.exe or cacls.exe to do so.
+
+Now we attempt to remove the user profile and the contents of the public directories. Typically this will fail for some files which are still in use, i.e. the file containing the HKCU registry hive.
+The dkwt.exe program first attempts to delete files/directories using internal routines. If these routines fail the
+
+~~~
+RD /S /Q "directory"
+DEL /Q /F "file"
+~~~
+
+commands are run.
+
+To remove artefacts which were not deleted during logout we attempt again on system shutdown, on boot and on each user login.
+In the system boot script there is the best chance to delete artefacts.
+
+On a user login the profile directory of the user currently logging in is excluded from the attempts to remove user profiles.
+
+###    Procedure for automatic cleanup
+
+Be carefully, cleaning up means deleting data! Configuration errors might result in loss of data!
+
+Create a dkwt.conf file (see below).
+
+Test the dkwt.conf file!
+
+Create a system startup script containing the
+~~~
+dkwt boot
+~~~
+command.
+
+Create a user logon script containing the
+~~~
+dkwt login
+~~~
+command.
+
+Create a user logoff script containing the
+~~~
+dkwt logout
+~~~
+command.
+
+Create a system shutdown script containing the
+~~~
+dkwt shutdown
+~~~
+command.
+
+**Special situation: system programming lectures:**
+If you teach system programming — i.e. building drivers for hardware — the system might crash or hang so you need a reset/reboot.
+You should take the following precautions against loss of data when testing self-made drivers:
+
+Create a registry key HKEY_LOCAL_MACHINE\Software\DKrause\Shared\dkwt and grant the Everyone or INTERACTIVE user or role full access to that key.
+Teach your students to use
+~~~
+dkwt keep
+~~~
+before running any test.
+
+Before logging out normally they should run:
+~~~
+dkwt unkeep
+~~~
+The "dkwt keep" command sets a DWORD named "keep" in the above registry key. If this DWORD is set to a not-0 value no cleanup is done by dkwt. So if there is any problem the user can reboot the machine (either normally or using the reset button) and login again without loosing data.
+The DWORD is removed at the end of the next "dkwt"login", so at next "dkwt logout" normal cleanup will happen.
+
+
+---
+
+&lt;a id="exitstatus" name="exitstatus"&gt;&lt;/a&gt;
+## Exit status
+
+0 on success, all other status codes indicate an error.
+
+---
+
+&lt;a id="configuration" name="configuration"&gt;&lt;/a&gt;
+## Configuration
+
+If the dkwt.exe file resides in "C:\Program Files\Krause\bin" the recommended directory for dkwt.conf is "C:\Program Files\Krause\etc\dktools-site". Create the directory if it does not yet exist.
+
+Example file:
+
+~~~
+[options]
+system user     =       System
+everyone user   =       Jeder
+print jobs      =       local   lp@printserver
+
+[public]
+c:\temp
+
+[profiles C:\Users]
+All Users
+Default User
+Public
+Administrator
+SophosSAUL-XY0
+sshd_server
+~~~
+
+Section|Option|Value|Purpose
+-------|------|-----|-------
+[options]|||General setup.
+|system user|Username|User name of the "System" user, optional, default: detect automatically.
+|everyone user|Username|User name of the "Everyone" user, optional, default: detect automatically.
+|print jobs|List of print queues to cleanup, LPRng print queues specified by queue@host, "local" for all local print queues.
+[public]|||Section containing public writeable directories, one per line. Each of these directories is cleaned up automatically.
+[profiles]||Full path name|Parent directories where all user profile directories are placed. Each line in the section contains one subdirectory name not subject to automatic cleanup by:&lt;br/&gt;&lt;pre&gt;&lt;code&gt;dkwt cleanup-profiles&lt;/code&gt;&lt;/pre&gt;&lt;br/&gt;All directories you don't want to be deleted during &lt;br/&gt;&lt;pre&gt;&lt;code&gt;dkwt cleanup-profiles&lt;/code&gt;&lt;/pre&gt;&lt;br/&gt; must be listed here. Make sure to include the profile directories of all systems accounts in the list.
+
+After creating or modifying the file, run
+
+~~~
+dkwt boot -t
+dkwt login -t
+dkwt logout -t
+dkwt shutdown -t
+~~~
+
+to see the files/directories to delete.
+
+---
+
+&lt;a id="restrictions" name="restrictions"&gt;&lt;/a&gt;
+## Restrictions
+
+The program is only available on Windows platforms.
+
+---
+
+&lt;a id="notes" name="notes"&gt;&lt;/a&gt;
+## Notes
+
+This program uses DK libraries version 3.
+
+---
+
+&lt;a id="examples" name="examples"&gt;&lt;/a&gt;
+## Examples
+
+###    List all users, long listing
+
+~~~
+dkwt users -l
+~~~
+
+###    List all groups
+
+~~~
+dkwt groups
+~~~
+
+###    List all printers, long listing
+
+~~~
+dkwt printers -l
+~~~
+
+###    Send file x.prn to default printer
+
+~~~
+dkwt print x.prn
+~~~
+
+###    Add directory to users PATH variable
+
+~~~
+dkwt env -a PATH C:\MyDirectory
+~~~
+
+###    Remove directory from users PATH variable
+
+~~~
+dkwt env -d PATH C:\MyDirectory
+~~~
+
+###    Add directory to system PATH variable
+
+~~~
+dkwtadm env -s -a PATH C:\MyDirectory
+~~~
+
+###    Remove directory from system PATH variable
+
+~~~
+dkwtadm env -s -d PATH C:\MyDirectory
+~~~
+
+###    Profiles cleanup on Windows Vista and above
+
+Make sure your dkwt.conf file is up to date, the [profiles] section must list the name of all profile directories to keep.
+
+Run
+
+~~~
+dkwtadm cleanup-profiles
+~~~
+
+---
+
+
+
+
+
+
+
+
+
+
+&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: left;"&gt;&lt;a href="../dkwt/" title="dkwt — List Windows users, groups, printers…"&gt;← Previous&lt;/a&gt;&lt;/td&gt;&lt;td style="text-align: center;"&gt;&lt;a href="../Home/" title="Home"&gt;↑ Home&lt;/a&gt;&lt;/td&gt;&lt;td style="text-align: center;"&gt;&lt;a href="../Home/#programs" title="Programs list"&gt;↑ Programs&lt;/a&gt;&lt;/td&gt;&lt;td style="text-align: right;"&gt;&lt;a href="../winprint/" title="winprint — Schedule file to Windows print queue"&gt;→ Next&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dirk Krause</dc:creator><pubDate>Fri, 28 Jul 2023 19:48:27 -0000</pubDate><guid>https://sourceforge.nete2995e03a19b41be52b208005cf27d7e09e849bf</guid></item><item><title>dkwt manual modified by Dirk Krause</title><link>https://sourceforge.net/p/dktools/wiki/dkwt%2520manual/</link><description/><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dirk Krause</dc:creator><pubDate>Fri, 28 Jul 2023 18:47:44 -0000</pubDate><guid>https://sourceforge.net48cee32ef087d24c6900b13edfde510acad0fff7</guid></item></channel></rss>