reggiep Posted October 14, 2004 Posted October 14, 2004 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
Rtano Posted October 14, 2004 Posted October 14, 2004 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
CoffeeFiend Posted October 14, 2004 Posted October 14, 2004 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,
staples Posted October 18, 2004 Posted October 18, 2004 @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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now