help with a snip of my batch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
erde0815
Posts: 1
Joined: 18 Nov 2008 05:56

help with a snip of my batch

#1 Post by erde0815 » 18 Nov 2008 08:07

Hi Folkz,

I made quiet a small batch, about 280 lines, to get a program configured which feels like it is written anno domini, it's a 16bit program.

At a single point the batch refuses to work. I would like to quote this lines and the error, because I hope somebody can help me to find the errors, cause it's driving me mad and I can't find my mistake and I'm hunting it for some hours.

The systemlanguage ist German.

Code: Select all

SET ok=0
REM [...] some lines (over 200) left out to keep the abridgment
  ECHO.
  SET /P rechner= Please give in the PC name:
  ECHO.
REM Antwort should be changed when systemlanuage is english
  ping -n 1 -w 5 %rechner% | find /i "Antwort" && goto :PingOk || goto :PcNumb
:PingOk
Rem the following path is for german windows
    NET USE R: \\%rechner%\C$\DOKUME~1\%vorname%.%nachname%\Desktop /persistent:no >Nul
REM this USE works in a cmd but not in this batch.
    xcopy /E /C /H H:\path\to\data\%nachname%\progi~1\ R:\ >Nul 
    IF EXIST R:\prognam~1\ ( SET /a ok=%ok%+1 )
    IF EXIST R:\prognam~1\FEHLER~1.LNK ( SET /a ok=%ok%+1 )
    IF EXIST R:\prognam~1\progi.LNK ( SET /a ok=%ok%+1 )
    IF EXIST R:\prognam~1\HILFEZ~1.LNK ( SET /a ok=%ok%+1 )
    IF EXIST R:\prognam~1\ZINSSATZ.LNK ( SET /a ok=%ok%+1 )
REM variable ok seams to stay 0 and can't be echoed
    IF "%ok%"!=="5" ( goto :PcNumb )
      ECHO.
      ECHO %ok% out of 5 files had been copied successfull :-^)
      ECHO.
    goto :EOF
:PcNumb
    ECHO %rechner% doesn't answer at %Time%
:eof


Errors that this batchpart produces are as following, translated by me:
* after the ping systemfailure 53 encountered
* networkpath not found
* %ok% in the Echo is missing it's like " out of 5 files had been copied successfull :-^)" without ""
* the data isn't copied to a PC btw.

thanks for any helpings

Post Reply