(view source code of rhomedir.cmd as plain text)
/* Restore remote home directory shares *//* Initialize RexxUtil */if RxFuncQuery( "SysFileTree" ) <> 0 then do
call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
call SysLoadFuncsend/* Do not display external commands */"@ECHO OFF"/* Check and interpret command line parameter */parse upper arg "\\"server"\"drive"$\"homedir_path dummy
if dummy <> "" then call Syntax
if server = "" then call Syntax
if drive = "" then call Syntax
if length( drive ) <> 1 then call Syntax
if homedir_path = "" then call Syntax
/* Read a list of all home directories */homedir_path = strip( homedir_path, "T", "\" )
homedirs = "\\"||server||"\"||drive||"$\"||homedir_path||"\*"
call SysFileTree homedirs, "homedir.", "DO"
if homedir.0 < 1 then do
call Syntax "NoDirs"
endelse do i = 1 to homedir.0
backslash = lastpos( "\", homedir.i )
share_name = substr( homedir.i, backslash + 1 )
commando = "NET ADMIN \\"||server||" /C"
commando = commando||" NET SHARE "||share_name||"="
commando = commando||drive||":\"||homedir_path||"\"||share_name
address CMD commandoendEXIT 0
Syntax:
param = translate( arg( 1 ) )
call SysCls saysay "RHOMEDIR, Version 1.01"
say "(C) 1999, Rob van der Woude"
saysay "Remotely restore the shares of all home directories."
saysay "Use LHomeDir if you want to restore local shares."
sayif param = "NODIRS" then do
say "No subdirectories found in"
say "\\"||server||"\"||drive||"$\"||homedir_path
say endsay "Usage: RHOMEDIR <homedir_unc>"
saysay "where <homedir_unc> is the UNC name of the directory"
say "containing the home directories"
EXIT 1
returnpage last modified: 2025-10-11; loaded in 0.0057 seconds