October 14, 200421 yr Hi,My first post so go easy on me!I am trying to knock together a batch file, I am a batch file duffer, that can do the following...Copy the normal.dot word template into the users directories.The directory structure is as followsc:\users\username\Perhaps this isn't possible but I thought that maybe someone may know differently.ThanksReg
October 14, 200421 yr well, i didnt understand EXATCLY what.....butcan it be similar at this.copy c:\PATH\TO\DOT c:\user\%username%so the dot file will be copied in the dir specified named AS the user DIexampleif the User is "Rtano" the script will copy the file in c:\user\RtanoI hope it works.Byez
October 14, 200421 yr You could easily do it in vbscript in several ways...-Filesystem object (collection; objFolder.SubFolders ... best way imho)-dir and testing if it's a directory (i like fso better)-FindFirstFile (bleh...)You'd also have to test not to copy to LocalService and NetworkService, and have some basic error handling and such.You could do something similar in other languages (perhaps even with for %%a in *.* type of deal in .bat/.cmd too if you get creative) I'm sure there are other ways to this as well. Anyways, it's definately possible, it's actually quite basic scripting,
October 18, 200421 yr @echo off c: dir /b "C:\Documents and Settings\*" > users.txt if %errorlevel%==0 FOR /F "eol=; delims=," %%i in (users.txt) do call :copydata "%%i" call :copydata "Default User"goto :eof:copydata echo %1 C: cd "c:\Documents and Settings" cd %1 xcopy "c:\copyfiles\*.*" "Application Data\*.*" /s/e/vgoto :eof
Create an account or sign in to comment