Jump to content

jeremyotten

Member
  • Posts

    68
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Netherlands

About jeremyotten

jeremyotten's Achievements

0

Reputation

  1. the GOD has returned ;-) only it works almost. users.txt groups.txt I get this error log Error! .FS03 Clientdo.DEPT.GROUPS.CAG.META - Switch P700511 needs an argument. Error! .FS03 LeesClientDo.DEPT.GROUPS.CAG.META - Switch P700240 needs an argument. Error! .FS03 PersBest.DEPT.GROUPS.CAG.META - Switch P700511 needs an argument. So it looks like every last P number per line doesn''t get the /B in front of it... :-( nevermind the script works you are the GOD!! ;-) problem was with TABS when copied from excel to notepad
  2. the GOD has returned ;-) only it works almost. users.txt groups.txt I get this error log Error! .FS03 Clientdo.DEPT.GROUPS.CAG.META - Switch P700511 needs an argument. Error! .FS03 LeesClientDo.DEPT.GROUPS.CAG.META - Switch P700240 needs an argument. Error! .FS03 PersBest.DEPT.GROUPS.CAG.META - Switch P700511 needs an argument. So it looks like every last P number per line doesn''t get the /B in front of it... :-(
  3. I was able to re-use something from the robocopy script. BUT. it's not complete @Echo off&Setlocal Set "_=0" For /f "delims=" %%# In (groups.txt) Do ( Set/a "_+=1"&Call :N_ %%_%% "%%#") Set "_="&Goto :Eof :N_ Set "$=0" For /f "delims=" %%# In (users.txt) Do ( Set/a "$+=1"&Call :O_ %%$%% "%%#" %1 %2) Set "$="&Goto :Eof :O_ If %3 Equ %1 RLGRPCRT.exe "%~4" /B %~2 now it outputs /B All value's while it should output /B Value1 / B Value2 etc etc Value ammount differs per line..
  4. ok I have a groups.txt and a users.txt the command should be RLGRPCRT.exe ".Line 1 of groups.txt.APPS.GROUPS.CARE" /B (Value1 of line 1 of users.txt) /B (Value2 if line 2 of users.txt) Yes I have tried and failed :-( Extra Info Lines in groups.txt can have spaces in it. Values in lines of users.txt do not have spaces. groups.txt has 1 group per line users.txt has multiple users(no spaces) per line every line in users.txt has a random number of users line1 of groups.txt should get all the member users of line 1 in users.txt
  5. Ok this is the case.. What I want to build is a script that reads a .txt file. the txt file has this format Line 1 ValueA ValueB1 - ValueBetc.... Line 2 ValueA ValueC1 - ValueCetc.... etc What I want is a script to read the txt file an file the command like this RLGRPCRT ValueA /B -member ValueB1 RLGRPCRT ValueA /B -member ValueB2 etc etc If one could help me out...
  6. I know you've already got a response you're happy with, but I'd just like to make a suggestion.I think the approach is slightly `heavy`! What I mean is that I think that setting a bunch of variables for each line of both files is intensive and probably not necessary based on your information. I would suggest something a little more like this @Echo off&Setlocal Set "_=0" For /f "delims=" %%# In (SOURCEDIR.TXT) Do ( Set/a "_+=1"&Call :N_ %%_%% "%%#") Set "_="&Goto :Eof :N_ Set "$=0" For /f "delims=" %%# In (DESTDIR.TXT) Do ( Set/a "$+=1"&Call _ %%$%% "%%#" %1 %2) Set "$="&Goto :Eof _ If %3 Equ %1 Robocopy "\\JEREMY\SOURCE$\%~4" "\\JEREMY\DESTINATION$\%~2" /mirAs you'll note I removed all that logging rubbish, If I wished to log anything it would be the actual robocopy command and for that I'd use it's /LOG switch. As a final note, if you did intend using a log file and you also wished to use the date and time in such a manner, I'd advise you to set both date and time to new variables once then use those variables for your expansion etc. Otherwise if the date/time changed during the formation of that file name you'd have all sorts of chaos. WOW i don''t understand a thing of what you are doing with that script but it does work indeed!! You are SCRIPTING GOD!!
  7. I created it myself with loging and with a static sourcedir.txt as well as destdir.txt ;-) @echo off CALL :ALL 1>ROBOCOPY_%DATE:~9,4%%DATE:~6,2%%DATE:~3,2%_%time:~1,1%u%time:~3,2%m.LOG 2>&1 EXIT :ALL setLocal EnableDelayedExpansion SET SOURCEROOT=\\JEREMY\SOURCE$ SET DESTROOT=\\JEREMY\DESTINATION$ set /A n=0 set /A m=0 for /f "tokens=* delims= " %%A in (SOURCEDIR.TXT) do ( set /a n+=1 set SOURCEDIR!n!=%%A set SOURCEs=!SOURCEs! !m! ) IF NOT EXIST DESTDIR.TXT ECHO Missing DESTDIR.TXT file& GOTO :END for /f "tokens=*" %%A in (DESTDIR.TXT) do ( set /a m+=1 set DESTDIR!m!=%%A set DESTs=!DESTs! !m! ) IF NOT %n%.==%m%. ECHO Unbalanced data &GOTO :END FOR %%A in (%DESTs%) DO ( robocopy "%SOURCEROOT%\!SOURCEDIR%%A!" "%DESTROOT%\!DESTDIR%%A!" /MIR ) :END pause
  8. and that's exactly what the posted code (based on yours) does. WAHT is the problem? jaclaz tested it like this @echo off setLocal EnableDelayedExpansion SET SOURCEROOT=\\JEREMY\SOURCE$ SET DESTROOT=\\JEREMY\DESTINATION$ set /A n=0 set /A m=0 for /f "tokens=* delims= " %%A in ('dir %SOURCEROOT% /A:D /B') do ( set /a n+=1 set SOURCEDIR!n!=%%A set SOURCEs=!SOURCEs! !m! ) IF NOT EXIST DESTDIR.TXT ECHO Missing DESTDIR.TXT file& GOTO :END for /f "tokens=*" %%A in (DESTDIR.TXT) do ( set /a m+=1 set DESTDIR!m!=%%A set DESTs=!DESTs! !m! ) IF NOT %n%.==%m%. ECHO Unbalanced data &GOTO :EOF FOR %%A in (%DESTs%) DO ( robocopy "%SOURCEROOT%\!SOURCEDIR%%A!" "%DESTROOT%\!DESTDIR%%A!" /MIR ) :END pause and it works! ;-) 1 request. What to do to output it to a logfile?
  9. This is what I want: step1 process the dir command and every line should become a variable step2 read the destinationdir text file and every line should become a variable step2 feed the variables to robocopy like "robocopy sourcedirvariable1 destinationdirvariable2 /MIR thats all. source and destination dirs should always be the same amount...
  10. This is what I want. Read root directory structure and set SOURCEDIR1 - etc per directory read a file named DESTDIR.TXT and set DESTDIR1 - etc variables after that robocopy should process everything this way robocopy sourcedir destinationdir /MIR till every variable is processed. This is what I have till now... but im stuck --> can''t seem to get the last robocopy part automated (also left in this script) SET SOURCEROOT=D:\TEST SET DESTROOT=D:\TEST2 @echo off setLocal EnableDelayedExpansion for /f "tokens=* delims= " %%a in ('dir %SOURCEROOT% /A:D /B') do ( set /a n+=1 set SOURCEDIR!n!=%%a ) for /f "tokens=*" %%b in (DESTDIR.TXT) do ( set /a m+=1 set DESTDIR!m!=%%b robocopy "%%a" "%%b" /MIR ) SET pause
  11. No where you See Datamex you should Read "Default Outlook Profile" the screens are wrong Under Default Outlook Profile you see als these wierd keys. In the keys could be the value with the user. The exe should search all keys under Default Outlook Profile and delete the One which has a part of that value .....
×
×
  • Create New...