home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 41,484 of 42,547   
   sean to foxidrive   
   Re: mapping drives over 26   
   11 Oct 16 13:55:58   
   
   From: sean@sean.eternal-september.org   
      
   foxidrive wrote:   
   > On 10/10/2016 17:55, sean wrote:   
   >> Yes, drive S: is in use for client 192.168.0.100 but then I unmount and   
   >> mount 192.168.0.200 also with S but this is when I get the error.   
   >>   
   >> Maybe I'll attempt having more than one list and see if it will go down   
   >> and through the lists sequentially.   
   >   
   >   
   > Your code is the problem in that case.   
   >   
   > This is a situation in programming where something can only be debugged   
   > effectively when eyeballs can see the code.   
   >   
      
   Does this help?   
      
   As mentioned earlier, I only changed one line.   
      
   this:   
   NET USE * \\%%A\c$ /user:%USER_NAME% %PASSWORD% > nul   
      
   to this:   
   NET USE S: \\%%A\c$ /user:%USER_NAME% %PASSWORD% > nul   
      
   Presume list.txt has 57 IP addresses.   
      
   ----   
      
   @echo off   
      
   SET LIST=list.txt   
   SETLOCAL EnableDelayedExpansion EnableExtensions   
   SET _DATE=%date:~10,4%%date:~4,2%%date:~7,2%   
   set _time=%TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%   
   set _minute=%TIME:~3,2%   
      
   net use * /del /yes > nul   
      
   FOR /F %%A in ('TYPE "%LSIT%"') do (   
      NET USE * \\%%A\c$ /user:%USER_NAME% %PASSWORD% > nul   
      SET file=\\%%A\c$\directory here\foo.bar.xml   
      
   SET ACCT_NUM=   
      FOR /F %%T IN ('bin\xml sel -t -v   
   "//Editable[@name='baz.bar']/@default" "!FILE!"') DO (SET D_NUM=%%T)   
      
      
   IF "!ACCT_NUM!" == "" (   
      ECHO %%A is dead, Jim.   
      GOTO END   
   ) ELSE (   
      ECHO.   
   )   
      
      
   bin\sqlite3.exe bin\data.db "INSERT INTO file(date, time, ip_address,   
   d_num) VALUES (%_DATE%, '%_TIME%', '%%A', '!D_NUM!');"   
      
   ) >> %_date%-%_minute%-results.txt   
   )   
      
   net use /del * /yes > nul   
      
   ----   
      
   Thanks for any input!   
      
      
   >   
   >   
   > The alternative just leads to premature baldness. ;)   
      
   yikes! let's keep our hair.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca