Suchen offener Perforce-Dateien unter Windows

Alle Dateien, die unter Perforce auf die Platte gesynced werden und nicht lokal geändert wurden, haben ein Read-Only-Flag. Ausnahme: Gebranchte Dateien in einer CL, die lokal nicht geändert wurden.

Um auch ohne Perforce-Anbindung rauszufinden, welche Dateien gerade lokal geändert wurden, kann man also nach Dateien suchen, die kein Read-Only-Flag mehr haben. Unter Windows geht das so:

dir /b /d /s /a-r-d Client-Root-Verzeichnis

Wie gesagt, wenn man Dateien in einer Branch-CL offen hat, erscheinen die hier nicht!

Perforce unter Cygwin

Um ein Windows-Perforce unter Cygwin laufen zu lassen, müssen die Pfade entsprechend angepasst werden, da die Windows-Perforce-Clients für den Client-Root die Windows-Pfad-Notation verwenden.

Die Anpassung kann mit der folgenden Bash-Wrapper-Funktion angepasst werden:

[geshi lang=bash]
ntp4 ()
{
here=”`cygpath -w \”$PWD\”`”;
PWD=”$here” //c/Program\ Files/Perforce/p4 “$@”
}
[/geshi]

Quelle: http://maillist.perforce.com/pipermail/perforce-user/2001-September/006820.html

mirror cygwin for local installation – enhanced version of mkcygwget

If you plan to install cygwin on a couple of computers or on a host with limited internet access you might want to have a local mirror of the installation packages for setup.exe . There’s already a handy script called mkcygwegt which does the job for you. All you have to do is to provide a mirror URL. It downloads setup.ini then parses it and generates a file which consists of the apporpriate wget calls (cygwget).

However, I was not really contend with this script and improved a bit the way how cygwget is generated: Continue reading “mirror cygwin for local installation – enhanced version of mkcygwget”

How to shutdown Windows XP via script

Basically there are two ways of shutting down Windows via Scripts: With admin-rights or without.

The tools that work with admin rights are:

  • shutdown.exe which comes with Windows XP Pro etc.
  • psshutdown.exe which comes with pstools (sysinternals.com)
  • the WMI method

Tools that work without admin rights: AutoIt-Script with single call “shutdown(13)”.

Granting access to non admin users to shutdown

In the  administrative tools – local security settings – local policies – user rights assignment:  Click “Force shutdown from a remote system” at the right. Click “Add User or Group”.  Enter the name INTERACTIVE and click “Check names”. This gives the right only to an interactive user. Its not possible to shutdown the computer over the network with that setting.