Hello –
I have a login script that builds a folder structure and copies data into it, my project took a turn and we decided not to wait for users to login. So now I need to modify or rebuild this login script to a script that I can run on the server against a drive containing home folders, roughly 2k of them.
Sense this is going to be running against a server I want to try and not overwhelm it by having mass copying. I would like to reference a list of directories to run against that I can populate.
Maybe something like Directory.txt = h:\data\User1,h:\data\User2,h:\data\User3,h:\data\User4
So being new to this I guess a loop that will somehow reference the directory file and change the folder name part of the path? Can someone please help me get this started? My login script is below.
Code:
;*************************************************************************
; Script Name: Netscape 4.7 to 7.1 Migration "net7mig.kix"
; Author: JTestman, UDF Error Functions Jooel Nieminen
; Date: 12/5/2005
; Requirements: Tested with kix 4.51
; Description: Based on AD group membership, Migrates 4.7 data to 7.1,
; creates 7.1 directory structures, copies 7.1 source data
; into 7.1 then moves 4.7 data into new dir structure,
; deletes 7.1 bookmarks and renames 4.7 bookmarks to 7.1.
; Renames %userprofile%\appdata\mozzila\registry.dat,
; then copies hard coded registry.dat from source directory.
;*************************************************************************
break on
dim $file, $fileversion, $47data1, $47data2, $file, $readini
dim $71data1, $71data2, $71data3, $SourceMozzila, $iniFileSource
dim $iniFileDeployed, $Sourcedata711, $Sourcedata712, $Sourcedata713
;Working Paths
$47data1 = 'c:\Data\Netscape'
$47data2 = 'c:\Data\Netscape\Cache'
$71data1 = 'c:\Data\Netscape7\Default User\userdata.slt'
$71data2 = 'c:\Data\Netscape7\Default User\userdata.slt\Cache'
$71data3 = 'c:\Data\Netscape7\Default User\userdata.slt\chrome'
$SourceMozzila = 'c:\Data\Source\Mozzila'
$Sourcedata711 = 'c:\Data\Source\Mozzila\Netscape7'
$Sourcedata712 = 'c:\Data\Source\Mozzila\Netscape7\Cache'
$Sourcedata713 = 'c:\Data\Source\Mozzila\Netscape7\chrome'
$Registry = '%userprofile%\Application Data\Mozilla\Registry.dat'
$file = '%userprofile%\Application Data\Mozilla'
$iniFileSource = 'c:\Data\Source\Mozzila\migration.ini'
$iniFileDeployed = '%userprofile%\Application Data\Mozilla\migration.ini'
$FileExistLog = 'c:\Data\Source\logs'
$ErrorFile = 'c:\Data\Source\logs\Errors.log'
;Check AD for group membership
;IF INGROUP('group')
;Check to see if migration.ini is present and value =True -
;if it is Exit script
$readini = ReadProfileString($iniFileDeployed, 'NetscapeMigration', 'Migrated71')
If $readini = True
LogErrors()
;Write log for file exsiting
RedirectOutput('$FileExistLog\%username%71Exist.txt',1)
?'Last login by '@USERID
?'NetBIOS name = '@WKSTA
?'This information was gathered on '@DATE' at '@TIME
LogErrors()
;Exit script
EXIT 1
;If the value isn't present in the migration.ini Do stuff
Else
;Make Netscape7 dir
MD $71data1
LogErrors()
MD $71data2
LogErrors()
MD $71data3
LogErrors()
;Copy 7.1 source files from share to user 7.1 directories
;Delete 7.1 bookmarks
copy '$Sourcedata711\*.*' '$71data1\*.*'
LogErrors()
copy '$Sourcedata712\*.*' '$71data2\*.*'
LogErrors()
copy '$Sourcedata713\*.*' '$71data3\*.*'
LogErrors()
del '$71data1\bookmarks.html'
LogErrors()
; copy netscape 4.7 data to 7.1
copy '$47data1\*.*' '$71data1\*.*'
LogErrors()
copy '$47data1\Cache\*.*' '$71data1\Cache\*.*'
LogErrors()
;Rename bookmarks file
move '$71data1\bookmark.htm' '$71data1\bookmarks.html'
LogErrors()
;Rename %userprofile%\Application Data\Mozilla\registry.dat
move '$file\registry.dat' '$file\registry.old'
LogErrors()
;Copy registry.dat from network share
copy '$SourceMozzila\registry.dat' '$file\registry.dat'
LogErrors()
;Create ini file to %username%\application data\mozilla\
writeprofilestring($iniFileDeployed, 'NetscapeMigration', 'Migrated71', 'True')
LogErrors()
;Write log Successful
RedirectOutput('$FileExistLog\%username%Migrated71.txt',1)
?'Last login by '@USERID
?'NetBIOS name = '@WKSTA
?'This information was gathered on '@DATE' at '@TIME
LogErrors()
;EndIF
EndIF
;Error logging function, UDFfunction LogErrors()
function LogErrors()
if @error
$errorString = @userid + "--> " + @serror + " (" + @error + ")"
$=RedirectOutput($ErrorFile)
$errorString ?
$=RedirectOutput($)
endif
endfunction