Listing 1: Example Nssetup.bat Batch File rem This is a working example of the autocreation of Netscape preferences. rem variables rem This section configures different personal settings in a common directory (\pc). rem Define these variables according to rem your site settings. rem set pcdir=z:\pc set nsdir=%pcdir%\netscape set nsprefs=%nsdir%\prefs.js set maildomain=ida.liu.se set mailserver=ida.liu.se set newsserver=news.ida.liu.se set startpage=http://www.ida.liu.se/ set organization=Linköping University set maildir=z:\\Mail set mailimapdir=Mail set fcc=z:\\Mail\\Sent set signaturefile=z:\\.signature rem This section checks to see if certain folders exist; if they do not, the batch file creates them. rem These folders are not necessary, but I use them to rem keep all PC settings in one directory, so they don't conflict rem with other operating system files when users log on from rem other platforms and access the home drive. rem Maybe create user's PC catalog. if not exist %pcdir% ( echo Creating %pcdir% mkdir %pcdir% ) rem Maybe create user's mail catalog. if not exist %maildir% ( echo Creating %maildir% mkdir %maildir% ) rem Maybe create user's Netscape catalog. if not exist %nsdir% ( echo Creating %nsdir% mkdir %nsdir% ) rem This section captures the user's full name from the doamin controller. rem rem You must enter the full name in the User Manager on the Primary Domain Controller. for /f "tokens=1,2*" %%i in ('net user %username% /domain') do ( if "%%i"=="Full" ( set fullname=%%k )) rem This section lists the preferences created, and if this information is already present, rem you jump directly to the end of the file. rem rem Compare the following lines with a prefs.js rem of your favor to match your site settings. These rem settings use IMAP4, store cache in c:\temp\netscape cache, rem and so on. You can find a more detailed guide of the settings rem at Netscape's homepage FAQ. if exist %nsprefs% goto prefsok echo Creating %nsprefs% echo full name for %username% is %fullname% echo maildomain %maildomain% echo mailserver %mailserver% echo newsserver %newsserver% echo startpage %startpage% echo organization %organization% echo maildir %maildir% echo mailimapdir %mailimapdir% echo // Netscape User Preferences >%nsprefs% echo // This is a generated file! Do not edit. >>%nsprefs% echo user_pref("network.hosts.smtp_server", "%mailserver%"); >>%nsprefs% echo user_pref("network.hosts.pop_server", "%mailserver%"); >>%nsprefs% echo user_pref("network.hosts.nntp_server", "%newsserver%"); >>%nsprefs% echo user_pref("browser.startup.homepage", "%startpage%"); >>%nsprefs% echo user_pref("browser.startup.homepage_override", false); >>%nsprefs% echo user_pref("browser.cache.directory", "c:\\temp\\Netscape Cache"); >>%nsprefs% echo user_pref("browser.window_rect", "0,0,632,480"); >>%nsprefs% echo user_pref("news.keep.method", 2); >>%nsprefs% echo user_pref("news.remove_bodies.by_age", true); >>%nsprefs% echo user_pref("mail.server_type", 1); >>%nsprefs% echo user_pref("mail.directory", "%maildir%"); >>%nsprefs% echo user_pref("mail.imap.server_sub_directory", "%mailimapdir%"); >>%nsprefs% echo user_pref("mail.default_fcc", "%fcc%"); >>%nsprefs% echo user_pref("news.default_fcc", "%fcc%"); >>%nsprefs% echo user_pref("mail.use_fcc", false); >>%nsprefs% echo user_pref("news.use_fcc", false); >>%nsprefs% echo user_pref("mail.check_new_mail", true); >>%nsprefs% echo user_pref("mail.pop_name", "%username%"); >>%nsprefs% echo user_pref("mail.identity.organization", "%organization%"); >>%nsprefs% echo user_pref("mail.identity.username", "%fullname%"); >>%nsprefs% echo user_pref("mail.identity.useremail", "%username%@%maildomain%"); >>%nsprefs% echo user_pref("mail.strictly_mime", true); >>%nsprefs% echo user_pref("mail.use_signature_file", true); >>%nsprefs% echo user_pref("mail.html_compose", false); >>%nsprefs% echo user_pref("mail.signature_file", "%signaturefile%"); >>%nsprefs% echo user_pref("editor.publish_keep_images", false); >>%nsprefs% echo user_pref("ldap_1.directory1.filename", "abook.nab"); >>%nsprefs% echo user_pref("ldap_1.directory2.filename", "X12H1C0J.nab"); >>%nsprefs% echo user_pref("ldap_1.directory3.filename", "XVG1QICK.nab"); >>%nsprefs% echo user_pref("ldap_1.directory4.filename", "XU1VT5FB.nab"); >>%nsprefs% echo user_pref("ldap_1.directory5.filename", "XVM08L6I.nab"); >>%nsprefs% echo user_pref("ldap_1.directory6.filename", "XUD0RIUA.nab"); >>%nsprefs% echo user_pref("ldap_1.end_of_directories", "9072896"); >>%nsprefs% echo user_pref("ldapList.version", 1); >>%nsprefs% echo user_pref("custtoolbar.personal_toolbar_folder", "Personal Toolbar Folder"); >>%nsprefs% echo user_pref("taskbar.x", 634); >>%nsprefs% echo user_pref("taskbar.y", 8); >>%nsprefs% :prefsok rem End of create user's Netscape prefs.