Per-User Neverwinter Nights on Windows
This is a copy of the original post I put on the NWN forums. I post it here because it’s my code.
First off, I’m an old *nix guy. So if you need an explination of why I would do this, that’s why. My wife users a Doze laptop and wants to be able to play at any computer, like I do.
I play NWN on *nix, so per user settings and games is pretty much the default (yes, there’s a script that does it). So, after geeting fed up with it, I designed this.
I tried to create a script using built-in Doze commands, however, they change between each version of the OS and are far too limited. This script uses the mv command from the Cygwin utilities http://www.cygwin.com. THIS SCRIPT WILL NOT WORK IF YOU DO NOT HAVE CYGWIN INSTALLED. There, is that clear enough.
Standard Disclaimer also applies. I am not responsible for damage done to your system, you, your dog, your girl/boyfriend, etc. by this script. You at your own risk.
@echo off
if exist c:\progra~1\nwn\dmvault goto :FILESEXIST
if exist c:\progra~1\nwn\localvault goto :FILESEXIST
if exist c:\progra~1\nwn\saves goto :FILESEXIST
setlocal
set user=%1
rem ############################################################
rem ### Setup local paths below here
set nwndir=”c:\Program FIles\nwn\”
set cygnwn=/cygdrive/c/Progra~1/nwn
set cyghome=/cygdrive/z/home
set defuser=sonya
rem ### End Setup local paths
rem ############################################################
rem Set a default user
if {%user%}=={} set user=%defuser%
echo User is %user%
echo Moving user files to NWN dir
c:\cygwin\bin\mv %cyghome%/%user%/.nwn/* %cygnwn%/
echo Launching Neverwinter
cd %nwndir%
nwmain.exe
echo Moving User files back to User dir
c:\cygwin\bin\mv %cygnwn%/nwnplayer.ini %cygnwn%/nwn.ini %cygnwn%/dmvault %cygnwn%/localvault %cygnwn%/saves %cyghome%/%user%/.nwn/
endlocal
goto END
:FILESEXIST
echo Files exist. Call somebody to fix this.
pause
:END
There are a couple of variables that can (read:should) be set in this script. I highly recommend that you use 8.3 file notation for paths. I would also set a default user.
Hopefully, someone will pick this up and make it better. Better yet, hopefully Microsoft and application developers will stop designing software without per-user settings. Sorry Bioware, but it’s true.
