Search Results

Search found 57 results on 3 pages for 'errorlevel'.

Page 1/3 | 1 2 3  | Next Page >

  • Handling nmake errorlevel/return codes

    - by tlianza
    Hi all, I have an nmake-based project which in turn calls the asp compiler, which can throw an error, which nmake seems to recognize: NMAKE : fatal error U1077: 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe' : return code '0x1' However, when I call nmake from within a batch file, the environment variable %ERRORLEVEL% remains set at zero: nmake /NOLOGO echo BUILD RETURNING: %ERRORLEVEL% If I control-c the nmake task, I do end up getting a non-zero ERRORLEVEL (it's set to 2) so my assumption is that I'm able to catch errors okay, but nmake isn't bubbling up the non-zero exit code from it's task. Or, at least, I'm mis-trapping it. Any help would be appreciated.

    Read the article

  • inconsistent ERRORLEVEL in a batch file

    - by Doron
    In a batch file, I have an inconsistent errorlevel behavior: The IP address 10.1.1.2 always replies. The following code always gives errorlevel 0 in one location (somewhere in the middle - exactly where i need it) inside the batch file. I copied only this snippet and placed it in the beginning and at the end of the batch file. In those locations, the result is always 1. Here is the code snippet: ping 10.1.1.2|Findstr /I /C:"timed out" /C:"host unreachable" echo %errorlevel% Any idea how to make it work also in the middle of the file? What am I doing wrong? I would hate to solve it with GOTOs(to the end of the file and back to where I need the result.)

    Read the article

  • Destination host unreachable, but the errorlevel is 0 (from a win7)

    - by Doron
    From a windows 7 machine, I ping a non existing ip address. C:ping 192.168.1.222 Pinging 192.168.1.222 with 32 bytes of data: Reply from 192.168.1.222: Destination host unreachable. Reply from 192.168.1.222: Destination host unreachable. Reply from 192.168.1.222: Destination host unreachable. Ping statistics for 192.168.1.222: Packets: Sent = 3, Received = 3, Lost = 0 (0% loss) Even though there is no reply, the errorlevel is set to 0. *what I am trying to do, is figure out if a remote machine is replying to ping. One of my test is to turn off the machine and ping it. For some reason, ping sets errorlevel to 0 *

    Read the article

  • Ping from windows 7 get no reply but sets errorlevel to 0

    - by Doron
    From a Windows 7 machine, I ping an IP address of a turned-off machine. C:\>ping 192.168.1.222 Pinging 192.168.1.222 with 32 bytes of data: Reply from 192.168.1.222: Destination host unreachable. Reply from 192.168.1.222: Destination host unreachable. Reply from 192.168.1.222: Destination host unreachable. Ping statistics for 192.168.1.222: Packets: Sent = 3, Received = 3, Lost = 0 (0% loss) Even though there is no reply, the errorlevel is set to 0. What I am trying to do, is figure out if a remote machine is replying to ping. One of my tests is to turn off the machine and ping it. For some reason, ping sets errorlevel to 0.

    Read the article

  • WMCI - how to get the ERRORLEVEL

    - by murxx
    Hi, I want to use the "wmic" command for finding out if a specific java process is still up and running. E.g. wmic process where "commandLine like '%ACTMonitor%' and executablePath like '%PATH1%' and name like '%java%'" The problem now is that the errorlevel of this command is always 0, no matter if there is a process listed or not. How can I manage to get an errorlevel != 0 in case the process is not up anymore? Or can one of you tell me another suggestion on how to be able to continue in a .bat script with this information... Thanks in advance!

    Read the article

  • Batch File - REN command's ErrorLevel returns 0 even on failure

    - by FMFF
    This is related to my earlier question. ren "C:\Temp\%%A" "C:\Temp\%%A" if errorlevel 0 ( "C:\Program Files\7-Zip\cmdline\7za.exe" a -tzip -mx9 "C:\temp\Zip\%%A.zip" "C:\temp\%%A" Move "C:\temp\%%A" "C:\Temp\Archive" ) In the above, the IF evaluates to true always, even if REN command fails. The idea is to check if a file is not locked by any other application, if not then Archive it and move it elsewhere. How best to do this? Thank you.

    Read the article

  • why doesn't winmain set the errorlevel?

    - by Brian R. Bondy
    int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { MessageBox(NULL, _T("This should return 90 no?"), _T("OK"), MB_OK); return 90; } Why does the above program correctly display the message box, but does not set the error level? I compile this program to the name a.exe. Then from command prompt I type: c:\> a.exe (message box is displayed, I press ok) c:\> echo %ERRORLEVEL% 0 I get the same results if I do exit(90); right before the return. It still says 0. I also tried to start the program via CreateProcess and obtain the result with GetExitCodeProcess but it also returns 0 to me. I did error checking to ensure it was all started correctly. I originally seen this problem in a more complex program. But made this simple program to verify the problem. Results are the same, both programs that have WinMain return 0 always. I tried both x64, x86 and unicode and MBCS compiling options. All give 0 as an error level/status code.

    Read the article

  • Batch file writing to log then ending process

    - by Andrew Service
    I have a batch file that calls a process and in that process I have: IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL% Now I wanted to upgrade this a bit and give some meaningful message to an output log when if the process fails, also I do not want the main batch to continue processing because the next processes are dependent on data from previous calls; I wonder if this would be correct but not sure: CALL Process 1 IF %ERRORLEVEL% NEQ 0 GOTO ErrorInfirstProcess /B %ERRORLEVEL% :ErrorInfirstProcess ECHO Process 1 Failed on %Date% at %Time%. >>C:\Log.txt" CALL Process 2 IF %ERRORLEVEL% NEQ 0 GOTO ErrorInSecondProcess /B %ERRORLEVEL% :ErrorInSecondProcess ECHO Process 2 Failed on %Date% at %Time%. >>C:\Log.txt" I also want to know if I still need the /B or do I need to put an EXIT command after the echo? Thanks A

    Read the article

  • How to reinstall OEM Windows 98 SE?

    - by Sammy
    I'm trying to install Windows 98 SE on an old PC and it's not going well. I run into this problem. Searching for Boot Record from Floppy..OK Starting Windows 98... TOSHIBA Enhanced-IDE CD/DVD-ROM Device Driver (ATAPI) Version 2.24 (C)Copyright Toshiba Corp. 1995-1999. All rights reserved. Device Name : TOSCD001 Number of units : 1 MSCDEX Version 2.25 Copyright (C) MIcrosoft Corp. 1986-1995. All rights reserved. Drive Z: = Driver TOSCD001 unit 0 TOSHIBA MACHINE Invalid drive specification Path not found - C:\TOOLS\CDROMDRV.SYS Invalid drive specification Invalid drive specification After that last line, it leaves me at a bitmap image displaying instructions to reboot with Ctrl+Alt+Del. It doesn't say why I have to reboot, and it doesn't state any error type, it just want's me to reboot for no apparent reason. After reboot, it just boots up from Floppy again and it cycles through the same thing all over again. The computer has been restored to original specification. Original system recovery "CD-ROM" discs are available and they are not scratched or anything, they are in very good condition. It's a set of 3 CDs, and the first disc labeled "1/3" should be the one holding the OEM version of Windows 98 SE. There is also a boot disk for Windows 98. I'm not sure what the other two discs are for. This computer came with three language support, so those could be holding different language versions or additional OEM discs. But I'm quite sure that the first disc holds the main operating system. BIOS has been set to optimized defaults. Boot priority is as follows; Floppy, IDE-0, CD-ROM. Under Standard CMOS settings, BIOS scans and autoconfigures both the hard drive and the CD/DVD drive. On POST it finds them both, and it finds the DOS bootdisk and starts preparing for installation, as you can see above. So what's this "invalid drive specification" about? Why isn't the installation starting? Updates Update 1 Booting from CD disc 2 In desperation I tried booting from the second CD. Boot order was; Floppy, CD-ROM, IDE-0. It boots normally from floppy disk, just like above, but then returns following. File not found - Z:\3LNGINST\TOOLS\PARTINFO.TXT I accidentally pressed some key on the keyboard, and before I knew it, the following screen showed up. Create Primary DOS Partition Current fixed disk drive: 1 Verifying drive integrity, 16% complete. After completion another screen showed up. Create Primary DOS Partition Current fixed disk drive: 1 Do you wish to use the maximum available size for a Primary DOS Partition and make the partition active (Y/N)?....................? [Y] Verifying drive integrity, 7% complete. I didn't choose Yes, it was set automatically. After completion the computer was automatically rebooted. Then I got a new screen. This is in Norwegian/Swedish/Finnish. Here's the message in Swedish. Hårddisken är inte klar för återställning av programvara. Installationsprogrammet måste skapa nya partitioner (C:, D:, ...). VARNING! ALLT INNEHÅLL PÅ HÅRDDISKEN KOMMER ATT RADERAS! Tryck på en tangent om du vill fortsätta (eller CTRL-C för att avbryta). Let me translate that. Hard drive is not ready for restoring the software. Setup program has to create new partitions (C:, D:, ...). WARNING! ALL CONTENTS ON THE HARD DRIVE WILL BE ERASED! Press any key to continue (or CTRL-C to cancel). I pressed Enter and it started formatting the hard drive. WARNING, ALL DATA ON NON-REMOVABLE DISK DRIVE c: WILL BE LOST! Proceed with Format (Y/N)?y Formatting 14,67.53M 1 percent completed. It automatically sets the "y" option and starts formatting. Rebooting with CD disc 1 After completing this operation it rebooted automatically. I inserted CD disc 1 and there was no issue with "invalid drive specification" anymore. Instead, a bitmap menu was displayed where it asked me to choose a language. And I thought I had it there for a while but it didn't work out. After choosing the language, another menu was displayed asking me to choose a type of recovery (restore pre-installed software OR restore hard drive partitions and pre-installed software). I opted for the second option. Then a data destruction warning showed up where I just pressed 1 to Continue. It did something and then just rebooted and the same formatting screen shows up as before. So something is not right. Am I doing it wrong? I seem to have come past the CD-ROM driver issue at least. But now I'm stuck with this problem... it seems to have something to do with the hard drive. Like... why is is it always trying to format it? Isn't it enough to format it once? By the way, it needs to be formatted as FAT32, right? Windows 98 doesn't support NTFS? I think FDISK should have taken care of this already. I know this is an old hard drive, but I connected to my main computer and it was able to read and write to it without a problem. It does have bad sectors though, but it's expected on an old hard drive like this. Any ideas?.. Update 2 I seem to be repeatedly getting stuck at the format screen where it asks to press any key to continue. So tried to cancel it this time with Ctrl+C. This leaves me at: A:\TOOLS> I can do DIR and CD and I tried to change to Z: drive. I tried running "setup" but there is no such thing. Z:\>setup Bad command or file name Update 3 Floppy structure Here's the file/folder structure of the floppy disk. A:\>dir /s Volume in drive A has no label. Volume Serial Number is 1700-1069 Directory of A:\ 1999-10-11 10:44 <DIR> BMP 1998-05-11 22:01 93 880 COMMAND.COM 1999-10-11 10:44 <DIR> factory 1999-10-11 10:44 <DIR> lang 1999-10-11 10:44 <DIR> TOOLS 2000-05-19 15:32 339 CONFIG.SYS 1999-10-26 13:38 0 BOOTLOG.TXT 2000-06-08 08:32 3 691 AUTOEXEC.BAT 4 File(s) 97 910 bytes Directory of A:\BMP 1999-10-11 10:44 <DIR> . 1999-10-11 10:44 <DIR> .. 0 File(s) 0 bytes Directory of A:\factory 1999-10-11 10:44 <DIR> . 1999-10-11 10:44 <DIR> .. 2000-06-08 13:09 2 662 3LNGINSF.BAT 1 File(s) 2 662 bytes Directory of A:\lang 1999-10-11 10:44 <DIR> . 1999-10-11 10:44 <DIR> .. 1998-11-24 08:02 49 575 FORMAT.COM 1998-11-24 08:02 63 900 FDISK.EXE 2 File(s) 113 475 bytes Directory of A:\TOOLS 1999-10-11 10:44 <DIR> . 1999-10-11 10:44 <DIR> .. 1998-05-06 22:01 49 575 FORMAT.COM 1995-10-27 20:29 28 164 BMPVIEW.EXE 1999-01-26 15:54 15 MAKEPA32.TXT 1998-05-06 22:01 3 878 XCOPY.EXE 1998-05-06 22:01 41 472 XCOPY32.MOD 1998-05-06 22:01 33 191 HIMEM.SYS 1998-05-06 22:01 125 495 EMM386.EXE 1998-05-06 22:01 18 967 SYS.COM 1996-01-31 21:55 18 CLK.COM 1994-04-02 08:20 22 HARDBOOT.COM 1999-02-03 15:46 15 MAKEPA16.TXT 1999-04-14 16:36 7 840 PARTFO32.EXE 2000-05-19 15:01 1 169 PARTFORM.BAT 1996-10-02 01:47 1 642 MBRCLR.COM 1999-07-01 11:58 8 175 BIOSCHKN.EXE 1998-06-23 08:55 5 904 PAR-TYPE.EXE 1998-11-24 08:02 29 271 MODE.COM 1998-11-24 08:02 15 252 ATTRIB.EXE 1998-11-24 08:02 19 083 DELTREE.EXE 1999-04-21 15:01 23 304 NTBB.EXE 1997-05-07 14:19 1 SYS.TXT 1999-07-01 12:23 61 566 F3DCHK.EXE 1998-05-11 20:01 34 566 KEYBOARD.SYS 1998-05-11 20:01 19 927 KEYB.COM 1999-10-26 14:31 910 partinfo.txt 1998-06-16 15:58 5 936 CHKDRVAC.EXE 1998-05-06 22:01 63 900 FDISK.EXE 1998-05-06 22:01 45 379 SMARTDRV.EXE 1992-12-03 19:48 10 695 SCISET.EXE 1997-06-25 15:49 6 YENT 1998-05-06 22:01 25 473 MSCDEX.EXE 1998-05-06 22:01 5 239 CHOICE.COM 1997-07-18 17:41 6 876 MBR.COM 1997-07-01 15:01 6 545 CHK2GB.COM 1998-06-10 20:04 8 128 PARTFORM.EXE 1990-01-04 02:09 19 MAKEPAR2.TXT 1990-01-04 01:00 27 MAKEPAR3.TXT 1990-01-04 01:00 27 MAKEPAR4.TXT 1998-02-13 13:47 15 MAKEPART.TXT 1999-04-14 13:47 5 200 DISKSIZE.EXE 1999-05-06 14:56 7 856 PARTFO16.EXE 1999-01-13 11:13 13 720 CDROMDRV.SYS 42 File(s) 734 463 bytes Total Files Listed: 49 File(s) 948 510 bytes 12 Dir(s) 268 800 bytes free A:\> CONFIG.SYS contents Here's the content of CONFIG.SYS. DEVICE=A:\TOOLS\HIMEM.SYS /TESTMEM:OFF REM I=B000-B7ff for Desktop BIOSes rem DEVICE=A:\TOOLS\EMM386.EXE NOEMS I=B000-B7ff x=C000-D000 DEVICE=A:\TOOLS\EMM386.EXE NOEMS x=C000-D000 DEVICE=A:\TOOLS\CDROMDRV.SYS /D:TOSCD001 BUFFERS=10 FILES=69 DOS=HIGH,UMB STACKS=9,256 LASTDRIVE=Z SWITCHES=/F SHELL=A:\COMMAND.COM /P /E:2048 AUTOEXEC.BAT contents :BEGIN @ECHO OFF PATH=A:\;A:\TOOLS; MSCDEX /D:TOSCD001 /L:Z /M:10 smartdrv 1024 128 SET TOOLS=A:\TOOLS SET COMSPEC=A:\COMMAND.COM SET EXITDRIVE=C: SET EXITPATH=\ CALL Z:\SETENV.BAT > NUL :TOSHCHK BIOSChkN IF NOT ERRORLEVEL 1 goto C_ACCESS BMPVIEW Z:\3LNGINST\BMP\NO_TOSP3.bmp /X=120 /Y=80 PAUSE > NUL SET EXITDRIVE=A: GOTO END :C_ACCESS CALL PARTFORM.BAT :C_EMPTY IF EXIST C:\*.* GOTO C_NOTEMPTY call z:\setenv.bat>nul goto PREPDU :C_NOTEMPTY REM ------------------MENU------------------------ :STARTMENU CLS BMPVIEW Z:\3LNGINST\BMP\LANGSELC.BMP /X=120 /Y=120 CLK CHOICE /C:123 /N >NUL REM L is the language that is selected IF ERRORLEVEL 1 SET L=%LNG1% IF ERRORLEVEL 2 SET L=%LNG2% IF ERRORLEVEL 3 SET L=%LNG3% SET BMP=BMP%L% BMPVIEW Z:\3LNGINST\%bmp%\HDDMENU.BMP /X=72 /Y=82 CLK CHOICE /C:129F /N > NUL IF ERRORLEVEL 4 GOTO FACTORY_MENU IF ERRORLEVEL 3 GOTO EXIT_MENU IF ERRORLEVEL 2 GOTO PARTFORM_MENU IF ERRORLEVEL 1 GOTO FORMAT_MENU GOTO END :FACTORY_MENU BMPVIEW Z:\3LNGINST\%bmp%\qformat.bmp /X=120 /Y=140 CLK choice /c:12 /N >nul IF ERRORLEVEL 2 GOTO STARTMENU IF ERRORLEVEL 1 GOTO FORMATF GOTO END :EXIT_MENU BMPVIEW Z:\3LNGINST\%bmp%\9.bmp /XC /X=96 /Y=267 choice /C:1pause /T:1,01 >nul SET EXITDRIVE=A: SET EXITPATH=\lang cls mode mono rem keyb xx>nul cls GOTO END :PARTFORM_MENU BMPVIEW Z:\3LNGINST\%bmp%\2.bmp /XC /X=96 /Y=216 choice /C:1pause /T:1,01 >nul BMPVIEW Z:\3LNGINST\%bmp%\partform.bmp /X=120 /Y=140 CLK choice /c:12 /N >nul IF ERRORLEVEL 2 GOTO STARTMENU IF ERRORLEVEL 1 GOTO PART_FORM SET EXITDRIVE=A: GOTO END :FORMAT_MENU BMPVIEW Z:\3LNGINST\%bmp%\1.bmp /XC /X=96 /Y=165 choice /C:1pause /T:1,01 >nul BMPVIEW Z:\3LNGINST\%bmp%\qformat.bmp /X=120 /Y=140 CLK choice /c:12 /N >nul IF ERRORLEVEL 2 GOTO STARTMENU IF ERRORLEVEL 1 GOTO FORMAT SET EXITDRIVE=A: GOTO END REM ------------------ MENU END ------------------------ :FORMAT bmpview Z:\3LNGINST\%bmp%\1.bmp /XC /X=145 /Y=235 choice /C:1pause /T:1,01 >nul CLS IF (%QFORMAT%)==(NO) GOTO FULLFO FORMAT C: /Q /V:"" <A:\TOOLS\YENT >NUL call z:\setenv.bat>nul goto PREPDU :FULLFO FORMAT C: /V:"" <A:\TOOLS\YENT call z:\setenv.bat>nul goto PREPDU :FORMATF CLS IF (%QFORMAT%)==(NO) GOTO FULLFO_F FORMAT C: /Q /V:"" <A:\TOOLS\YENT >NUL call z:\setenv.bat>nul goto PREPDU_F :FULLFO_F FORMAT C: /V:"" <A:\TOOLS\YENT call z:\setenv.bat>nul goto PREPDU_F :PART_FORM bmpview Z:\3LNGINST\bmp\1.bmp /XC /X=145 /Y=235 choice /C:1pause /T:1,01 >nul MBR /! HARDBOOT REM ====================== Triple Select ====================== :PREPDU XCOPY z:\3LNGINST\*.* C:\*.* /E /S /V >NUL ATTRIB -H -R -S C:\TOOLS\CDROMDRV.SYS COPY A:\TOOLS\CDROMDRV.SYS C:\TOOLS /Y SYS C: >NUL goto REBOOT :PREPDU_F copy A:\TOOLS\SMARTDRV.EXE C:\ /Y ATTRIB -H -R -S C:\SMARTDRV.EXE copy A:\FACTORY\3LNGINSF.bat c:\ c:\3LNGINSF.bat cls REM ====================== Dual Select END ====================== REM --------------- END ------------------ :REBOOT SMARTDRV.EXE /C bmpview Z:\3LNGINST\BMP\reboot3.bmp /X=120 /Y=140 :FOREVER pause >nul goto FOREVER :END SMARTDRV.EXE /C %EXITDRIVE% cd %EXITPATH% echo on CD structure S:\>dir /s Volume in drive S is T3ELK4SC Volume Serial Number is 2042-5BC9 Directory of S:\ 2000-08-22 14:14 <DIR> 3LNGINSF 2000-08-22 14:14 <DIR> 3LNGINST 2000-06-15 15:57 <DIR> CRC 2000-06-15 12:04 387 667 767 T310C1NO.W98 2000-09-07 15:36 273 setenv.BAT 2 File(s) 387 668 040 bytes Directory of S:\3LNGINSF 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1999-10-27 10:51 1 806 AUTOEXEC.BAT 2000-08-22 14:14 <DIR> BMP 2000-05-19 15:29 265 CONFIG.SYS 2000-08-22 14:14 <DIR> POSTINST 2000-08-22 14:14 <DIR> TOOLS 2000-08-22 14:14 <DIR> WIN98SYS 2 File(s) 2 071 bytes Directory of S:\3LNGINSF\BMP 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1997-04-22 09:43 718 1.BMP 1997-04-22 09:44 718 2.BMP 1999-01-04 02:38 718 3.BMP 2000-07-05 11:22 60 118 Cdchg2.bmp 2000-07-05 11:22 60 118 Cdchg3.bmp 2000-07-05 13:37 60 118 Fin.bmp 2000-07-06 14:18 120 118 Menu.bmp 2000-07-05 13:34 60 118 Nor.bmp 2000-07-05 11:53 35 318 Progress.bmp 2000-07-05 13:40 60 118 Swe.bmp 2000-07-05 12:09 84 118 Wrongcd2.bmp 2000-07-05 12:09 84 118 Wrongcd3.bmp 12 File(s) 626 416 bytes Directory of S:\3LNGINSF\POSTINST 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 2000-05-19 09:15 33 POSTINST.BAT 1 File(s) 33 bytes Directory of S:\3LNGINSF\TOOLS 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 2000-07-06 14:49 3 593 3LNGINST.BAT 1998-11-24 08:02 15 252 ATTRIB.EXE 1995-10-27 18:29 28 164 BMPVIEW.EXE 1999-01-13 11:13 13 720 CDROMDRV.SYS 1998-05-06 20:01 5 239 CHOICE.COM 1996-01-31 19:55 18 CLK.COM 1998-11-24 08:02 19 083 DELTREE.EXE 1998-05-06 20:01 125 495 EMM386.EXE 1999-07-01 12:23 61 566 F3DCHK.EXE 1998-05-06 20:01 49 575 FORMAT.COM 1994-04-02 06:20 22 HARDBOOT.COM 1998-05-06 20:01 33 191 HIMEM.SYS 1998-05-06 20:01 25 473 MSCDEX.EXE 1998-05-06 20:01 12 663 RAMDRIVE.SYS 1998-05-06 20:01 45 379 SMARTDRV.EXE 1997-05-07 14:19 1 SYS.TXT 1995-09-27 14:25 6 813 VOLCHECK.EXE 1998-05-06 20:01 3 878 XCOPY.EXE 1998-05-06 20:01 41 472 XCOPY32.MOD 1997-06-25 13:49 6 YENT 20 File(s) 490 603 bytes Directory of S:\3LNGINSF\WIN98SYS 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1998-12-04 20:00 222 390 IO.SYS 1998-05-06 20:01 18 967 SYS.COM 1998-05-06 20:01 93 880 command.com 3 File(s) 335 237 bytes Directory of S:\3LNGINST 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1999-05-31 09:51 1 576 AUTOEXEC.BAT 2000-08-22 14:14 <DIR> BMP 2000-08-22 14:14 <DIR> Bmpfin 2000-08-22 14:14 <DIR> Bmpnor 2000-08-22 14:14 <DIR> Bmpswe 2000-05-19 15:30 265 CONFIG.SYS 2000-08-22 14:14 <DIR> POSTINST 2000-08-22 14:14 <DIR> TOOLS 2000-08-22 14:14 <DIR> WIN98SYS 2 File(s) 1 841 bytes Directory of S:\3LNGINST\BMP 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1997-04-22 09:43 718 1.BMP 1997-04-22 09:44 718 2.BMP 1999-01-04 02:38 718 3.BMP 2000-07-05 11:22 60 118 Cdchg2.bmp 2000-07-05 11:22 60 118 Cdchg3.bmp 2000-07-05 13:37 60 118 Fin.bmp 2000-07-06 14:18 120 118 Menu.bmp 2000-07-05 13:34 60 118 Nor.bmp 2000-07-05 11:53 35 318 Progress.bmp 2000-07-06 14:08 40 518 Reboot3.bmp 2000-07-05 13:40 60 118 Swe.bmp 2000-07-05 12:09 84 118 Wrongcd2.bmp 2000-07-05 12:09 84 118 Wrongcd3.bmp 2000-07-05 13:52 48 118 langselc.bmp 2000-07-05 11:47 57 318 no_tosp3.bmp 15 File(s) 772 370 bytes Directory of S:\3LNGINST\Bmpfin 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1997-04-22 09:43 718 1.BMP 1997-04-22 09:44 718 2.BMP 1998-06-13 00:07 718 9.bmp 2000-03-08 15:02 78 486 Hddmenu.bmp 2000-03-08 15:31 25 318 No_tospc.bmp 2000-03-08 15:37 36 518 PARTFORM.BMP 2000-03-08 15:42 36 518 Qformat.bmp 7 File(s) 178 994 bytes Directory of S:\3LNGINST\Bmpnor 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1997-04-22 09:43 718 1.BMP 1997-04-22 09:44 718 2.BMP 1998-06-13 00:07 718 9.bmp 1999-05-05 13:26 78 486 Hddmenu.bmp 1998-07-13 11:36 25 318 No_tospc.bmp 1998-07-13 11:41 36 518 PARTFORM.BMP 1998-07-13 11:45 36 518 Qformat.bmp 7 File(s) 178 994 bytes Directory of S:\3LNGINST\Bmpswe 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1997-04-22 09:43 718 1.BMP 1997-04-22 09:44 718 2.BMP 1998-06-13 00:07 718 9.bmp 1999-05-06 08:14 78 486 Hddmenu.bmp 1998-07-10 16:25 25 318 No_tospc.bmp 1998-07-10 16:29 36 518 PARTFORM.BMP 1998-07-10 17:08 36 518 Qformat.bmp 7 File(s) 178 994 bytes Directory of S:\3LNGINST\POSTINST 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 2000-05-19 09:15 33 POSTINST.BAT 1 File(s) 33 bytes Directory of S:\3LNGINST\TOOLS 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 2000-05-19 14:52 3 898 3LNGINST.BAT 1995-10-27 18:29 28 164 BMPVIEW.EXE 1999-01-13 11:13 13 720 CDROMDRV.SYS 1998-05-06 20:01 5 239 CHOICE.COM 1996-01-31 19:55 18 CLK.COM 1998-05-06 20:01 125 495 EMM386.EXE 1999-07-01 12:23 61 566 F3DCHK.EXE 1998-05-06 20:01 49 575 FORMAT.COM 1994-04-02 06:20 22 HARDBOOT.COM 1998-05-06 20:01 33 191 HIMEM.SYS 1998-05-06 20:01 25 473 MSCDEX.EXE 2000-07-06 14:41 910 PARTINFO.TXT 1998-05-06 20:01 12 663 RAMDRIVE.SYS 1998-05-06 20:01 45 379 SMARTDRV.EXE 1997-05-07 14:19 1 SYS.TXT 1995-09-27 14:25 6 813 VOLCHECK.EXE 1998-05-06 20:01 3 878 XCOPY.EXE 1998-05-06 20:01 41 472 XCOPY32.MOD 1997-06-25 13:49 6 YENT 19 File(s) 457 483 bytes Directory of S:\3LNGINST\WIN98SYS 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 1998-12-04 20:00 222 390 IO.SYS 1998-05-06 20:01 18 967 SYS.COM 1998-05-06 20:01 93 880 command.com 3 File(s) 335 237 bytes Directory of S:\CRC 1601-01-01 02:00 <DIR> . 1601-01-01 02:00 <DIR> .. 2000-06-15 12:07 181 422 T310C1NO.ALL 2000-06-15 12:09 215 427 T310C1NO.CRC 2000-06-15 12:07 2 157 T310C1NO.HID 3 File(s) 399 006 bytes Total Files Listed: 104 File(s) 391 625 352 bytes 42 Dir(s) 0 bytes free S:\> Now which line or lines need to be changed? Do I really have to change drive letter Z: to C:? Proposed solutions Solution #1 Ramhound proposed to change the boot order to following; CD-ROM, IDE-0, Floppy This didn't help. In fact, here is the result of it. Searching for Boot Record from CDROM..Not Found Searching for Boot Record from IDE-0.. OK Missing operating system Any other ideas?... Solution #2 Rik proposed to run Z:\setup. Now that I have found a way to drop to DOS prompt with Ctrl+C as described above (Update 2), I did try running setup but there is no such command or file in there. So that didn't work.

    Read the article

  • Windows batch file: Pipe destroys my return code

    - by murxx
    Hi, is it possible to return the errorlevel also if I pipe the output of a script into a logfile: test1.bat: call test2.bat 2>&1 | tee log.txt echo ERRORLEVEL: %ERRORLEVEL% test2.bat: exit /B 1 Output when calling test1.bat: ERRORLEVEL: 0 The errorlevel is always 0. The problem is, I want to call another script inside my script where the output should be redirected synchronously with the output shown in the command line, therefore a simple is not enough for me. I tried several ideas, but result is that the pipe always seems to destroy the given error-level... :( Can you give me any further suggestions? Thanks in advance... :)

    Read the article

  • Process Close does not close a process when performed in a SetTimer label

    - by NbdNnm
    The script below creates a child process to perform FileExist() separately from the main script so that it avoids halting the script when an unknown network path is passed. However, the command, Process close, does not close the given process despite its ErrorLevel indicates it succeeded to close. Task Manager shows the child process still exists. FileExistTimeout() ; this checks if the necessary parameters are passed ; this checks if the given path exists by creating a child process with the given timeout PathToCheck := "\\1.2.3.4\test" msgbox, 64, Test Result, % FileExistTimeout(PathToCheck) "`n" ErrorLevel FileExistTimeout(strPath="", nTimeout=1000, strSwitch="/fe") { global strParam1 = %1% strParam2 = %2% ; if the function is used to check the script parameters if (strPath="") { if (strParam2 = strSwitch) && strParam1 ; this means the function is placed at the beginning of the script. ExitApp % (FileExist(strParam1) != "") + 1 ; Return 1 or 2. Return } ; create a child process to check the path tooltip, RunWait is performing.... SetTimer, FileExistTimeout, % -1 * nTimeout RunWait "%A_AhkPath%" "%A_ScriptFullPath%" "%strPath%" "%strSwitch%",,, nPID SetTimer, FileExistTimeout, Off ; Disable the timer (if it hasn't fired already). tooltip ; ErrorLevel contains the exit code of the process (from RunWait). if ErrorLevel = 2 ; found return true else if ErrorLevel = 1 ; not found return return ; timeout FileExistTimeout: Process Close, %nPID% ; Timed out - terminate the process. tooltip, % "Process Closed: " ErrorLevel "`n" "Used Pid: " nPID,,, 2 return }

    Read the article

  • Fixing Robocopy for SQL Server Jobs

    - by Most Valuable Yak (Rob Volk)
    Robocopy is one of, if not the, best life-saving/greatest-thing-since-sliced-bread command line utilities ever to come from Microsoft.  If you're not using it already, what are you waiting for? Of course, being a Microsoft product, it's not exactly perfect. ;)  Specifically, it sets the ERRORLEVEL to a non-zero value even if the copy is successful.  This causes a problem in SQL Server job steps, since non-zero ERRORLEVELs report as failed. You can work around this by having your SQL job go to the next step on failure, but then you can't determine if there was a genuine error.  Plus you still see annoying red X's in your job history.  One way I've found to avoid this is to use a batch file that runs Robocopy, and I add some commands after it (in red): robocopy d:\backups \\BackupServer\BackupFolder *.bak rem suppress successful robocopy exit statuses, only report genuine errors (bitmask 16 and 8 settings)set/A errlev="%ERRORLEVEL% & 24" rem exit batch file with errorlevel so SQL job can succeed or fail appropriatelyexit/B %errlev% (The REM statements are simply comments and don't need to be included in the batch file) The SET command lets you use expressions when you use the /A switch.  So I set an environment variable "errlev" to a bitwise AND with the ERRORLEVEL value. Robocopy's exit codes use a bitmap/bitmask to specify its exit status.  The bits for 1, 2, and 4 do not indicate any kind of failure, but 8 and 16 do.  So by adding 16 + 8 to get 24, and doing a bitwise AND, I suppress any of the other bits that might be set, and allow either or both of the error bits to pass. The next step is to use the EXIT command with the /B switch to set a new ERRORLEVEL value, using the "errlev" variable.  This will now return zero (unless Robocopy had real errors) and allow your SQL job step to report success. This technique should also work for other command-line utilities.  The only issues I've found is that it requires the commands to be part of a batch file, so if you use Robocopy directly in your SQL job step you'd need to place it in a batch.  If you also have multiple Robocopy calls, you'll need to place the SET/A command ONLY after the last one.  You'd therefore lose any errors from previous calls, unless you use multiple "errlev" variables and AND them together. (I'll leave this as an exercise for the reader) The SET/A syntax also permits other kinds of expressions to be calculated.  You can get a full list by running "SET /?" on a command prompt.

    Read the article

  • How can I detect upload success/failure in a scripted command-line SFTP session

    - by pkpk
    how can I detect success/failure sftp Batch script on Windows OS? I use %errorlevel% to detect success/failure, sometime the %errorlevel% be returned by 0, but that session is fail and the file is not upload to the server. my script is below how can I detect sftp uploaded correctly? THX so much @echo off (echo cd %4 echo put %2 echo exit)>sftpScript.txt sftp -b sftpScript.txt %3 set result=%errorlevel% if result EQU 0 ( del sftpScript.txt del %2 ) else ( del sftpScript.txt ) exit %result%

    Read the article

  • variable in variable in batch and delayed expansion

    - by rezna
    Hi, I'm trying to use variable in variable in conjunction with delayed expansion but still no luck. SETLOCAL EnableDelayedExpansion SET ERROR_COMMAND=exit /B ^!ERRORLEVEL^! This is my last try. I want to setup an ERROR_COMMAND to be called when one of the steps in batch file crashes. The command is supposed to be: IF ERRORLEVEL 1 !ERROR_COMMAND! or IF ERRORLEVEL 1 %ERROR_COMMAND% The thing is, I'm not able to find out, how to SET properly the ERROR_COMMAND variable, so that ERRORLEVEL is not evaluated at the time of assignment, but at the time of evaluating the variable Of course I can copy&paste the code all over the batch file, but using the variable just seems a bit prettier... Anyone? Thanks, Milan

    Read the article

  • Why does findstr not handle case properly (in some circumstances)?

    - by paxdiablo
    While writing some recent scripts in cmd.exe, I had a need to use findstr with regular expressions - customer required standard cmd.exe commands (no GnuWin32 nor Cygwin nor VBS nor Powershell). I just wanted to know if a variable contained any upper-case characters and attempted to use: > set myvar=abc > echo %myvar%|findstr /r "[A-Z]" abc > echo %errorlevel% 0 When %myvar% is set to abc, that actually outputs the string and sets errorlevel to 0, saying that a match was found. However, the full-list variant: > echo %myvar%|findstr /r "[ABCDEFGHIJKLMNOPQRSTUVWXYZ]" > echo %errorlevel% 1 does not output the line and it correctly sets errorlevel to 1. In addition: > echo %myvar%|findstr /r "^[A-Z]*$" > echo %errorlevel% 1 also works as expected. I'm obviously missing something here even if it's only the fact that findstr is somehow broken. Why does the first (range) regex not work in this case? And yet more weirdness: > echo %myvar%|findstr /r "[A-Z]" abc > echo %myvar%|findstr /r "[A-Z][A-Z]" abc > echo %myvar%|findstr /r "[A-Z][A-Z][A-Z]" > echo %myvar%|findstr /r "[A]" The last two above also does not output the string!!

    Read the article

  • "dynamic" keyword and JSON data

    - by Peter Perhác
    An action method in my ASP.NET MVC2 application returns a JsonResult object and in my unit test I would like to check that the returned JSON object indeed contains the expected values. I tried this: 1. dynamic json = ((JsonResult)myActionResult).Data; 2. Assert.AreEqual(JsonMessagesHelper.ErrorLevel.ERROR.ToString(), json.ErrorLevel); But I get a RuntimeBinderException "'object' does not contain a definition for 'ErrorLevel'". However, when I place a breakpoint on line 2 and inspect the json dynamic variable (see picture below), it obviously does contain the ErrorLevel string and it has the expected value, so if the runtime binder wasn't playing funny the test would pass. What am I not getting? What am I doing wrong and how can I fix this? How can I make the assertion pass?

    Read the article

  • Foolproof way to check for nonzero (error) return code in windows batch file

    - by Pat
    Intro There's a lot of advice out there for dealing with return codes in batch files (using the ERROLEVEL mechanism), e.g. Get error code from within a batch file ERRORLEVEL inside IF Some of the advice is to do if errorlevel 1 goto somethingbad, while others recommend using the %ERRORLEVEL% variable and using ==, EQU, LSS, etc. There seem to be issues within IF statements and such, so then delayedexpansion is encouraged, but it seems to come with quirks of its own. Question What is a foolproof (i.e. robust, so it will work on nearly any system with nearly any return code) way to know if a bad (nonzero) code has been returned? My attempt For basic usage, the following seems to work ok to catch any nonzero return code: if not errorlevel 0 ( echo error level was nonzero )

    Read the article

  • Using systeminfo to get the OS Name

    - by WileCau
    I need to find the flavor of Windows that is running using a batch file that will run on anything from Windows NT to Windows 7. I'm using a method based on this page with some minor changes. Systeminfo gives the flavor of Windows that is running. Is there any authoritative list of names that can be returned? If so where would I find the list? My intention is to do something like: winVer=Unknown rem NT doesn't have systeminfo ver | find "Windows NT" > nul if %errorlevel%==0 set winVer=WinNT for /f "delims=: tokens=2" %%v in ('sysinfo ^| find "OS Name"') do ( set verStr=%%v ) echo %verStr% | find "Windows XP" > nul if %errorlevel%==0 set winVer=WinXP echo %verStr% | find "Windows Vista" > nul if %errorlevel%==0 set winVer=WinVista ... etc Thanks

    Read the article

  • Files not waiting for each other

    - by Sunny
    I have two batch files as follows in which file2.bat is dependent on file1.bat's output: file1.bat @ECHO OFF setlocal enabledelayedexpansion SET "keystring1=" ( FOR /f "delims=" %%a IN ( Source.txt ) DO ( ECHO %%a|FIND "Appprocess.exe" >NUL IF NOT ERRORLEVEL 1 SET keystring1=%%a FOR %%b IN (App1 App2 App3 App4 App5 App6 ) DO ( ECHO %%a|FIND "%%b" >NUL IF NOT ERRORLEVEL 1 IF DEFINED keystring1 CALL ECHO(%%keystring1%% %%b&SET "keystring1=" )))>result.txt GOTO :EOF file2.bat @echo off setlocal enabledelayedexpansion (for /f "tokens=1,2" %%a in (memory.txt) do ( for /f "tokens=5" %%c in ('find " %%a " ^< result.txt ') do echo %%c %%b ))> new.txt file1.bat usually takes 60 sec to complete its execution. In master.bat file i am calling above two files as: call file1.bat call file2.bat but file2.bat is not waiting for file1.bat to complete its execution. Even , i tried to call file2.bat within file1.bat as below but still its not waiting for file1.bat to get completed: @ECHO OFF setlocal enabledelayedexpansion SET "keystring1=" ( FOR /f "delims=" %%a IN ( Source.txt ) DO ( ECHO %%a|FIND "HsvDataSource.exe" >NUL IF NOT ERRORLEVEL 1 SET keystring1=%%a FOR %%b IN (EUHFMPROD USHFMPROD TL2TEST GSHFMPROD TL2PROD GSARCH1213 TL2FY13) DO ( ECHO %%a|FIND "%%b" >NUL IF NOT ERRORLEVEL 1 IF DEFINED keystring1 CALL ECHO(%%keystring1%% %%b&SET "keystring1=" )))>file2.txt GOTO :EOF call file1.bat I also tried below start option, but no effect.: start file1.bat /wait call file2.bat Not getting ..why its happening..?

    Read the article

  • What is wrong with this recursive Windows CMD script? It won't do Ackermann properly

    - by boost
    I've got this code that I'm trying to get to calculate the Ackermann function so that I can post it up on RosettaCode. It almost works. I thought maybe there'd be a few batch file wizards on StackOverflow. ::echo off set depth=0 :ack if %1==0 goto m0 if %2==0 goto n0 :else set /a n=%2-1 set /a depth+=1 call :ack %1 %n% set t=%errorlevel% set /a depth-=1 set /a m=%1-1 set /a depth+=1 call :ack %m% %t% set t=%errorlevel% set /a depth-=1 if %depth%==0 ( exit %t% ) else ( exit /b %t% ) :m0 set/a n=%2+1 if %depth%==0 ( exit %n% ) else ( exit /b %n% ) :n0 set /a m=%1-1 set /a depth+=1 call :ack %m% %2 set t=%errorlevel% set /a depth-=1 if %depth%==0 ( exit %t% ) else ( exit /b %t% ) I use this script to test it @echo off cmd/c ackermann.cmd %1 %2 echo Ackermann of %1 %2 is %errorlevel% A sample output, for Test 1 1, gives: >test 1 1 >set depth=0 >if 1 == 0 goto m0 >if 1 == 0 goto n0 >set /a n=1-1 >set /a depth+=1 >call :ack 1 0 >if 1 == 0 goto m0 >if 0 == 0 goto n0 >set /a m=1-1 >set /a depth+=1 >call :ack 0 0 >if 0 == 0 goto m0 >set/a n=0+1 >if 2 == 0 (exit 1 ) else (exit /b 1 ) >set t=1 >set /a depth-=1 >if 1 == 0 (exit 1 ) else (exit /b 1 ) >set t=1 >set /a depth-=1 >set /a m=1-1 >set /a depth+=1 >call :ack 0 1 >if 0 == 0 goto m0 >set/a n=1+1 >if 1 == 0 (exit 2 ) else (exit /b 2 ) >set t=2 >set /a depth-=1 >if 0 == 0 (exit 2 ) else (exit /b 2 ) Ackermann of 1 1 is 2

    Read the article

  • Concatenate a variable with a string

    - by user311130
    Hello all, I wrote a small bat file: @echo off rem runs the {arg[0].exe} - using its fully qualified name %~f1 IF %errorlevel% NEQ 0 (set boolResult=False) ELSE (set boolResult=True) rem case1 EVENTCREATE /T ERROR /ID 700 /L "MyTest Application" /D "exitcode: %errorlevel%; session id is %SessionName%" rem case3 EVENTCREATE /T ERROR /ID 700 /L APPLICATION /D "exitcode: %boolResult%; session id is %SessionName%" rem case4 EVENTCREATE /T ERROR /ID 700 /L APPLICATION /D "exitcode: %errorlevel%; session id is %SessionName%" And I have got some questions, if you could help me out... case1: I get the following error: ERROR: 'MyTest Application' log does not exist. Cannot create the event. *The only way to initial eventlog in through high-leve (c#) code? case3: How can I concatenate a string with some bat variable ? case4: How do I add a newline in the description? "exitcode: %boolResult%\n session id is %SessionName%" didn't do that. Thanks for any assistance

    Read the article

  • Save output and exit code of command to files on windows

    - by poncha
    I want to run a command and save its output and its exit code, in different files. Here's what i am doing: cmd.exe /C command 1> %TEMP%\output.log 2> %TEMP%\error.log && echo %ERRORLEVEL% > %TEMP%\status || echo %ERRORLEVEL% > %TEMP%\status If i don't do output redirection (into %TEMP%\output.log and/or %TEMP%\error.log), then exit code is saved just fine. However, when i run the line as shown above more than once (just get back to previous line in command prompt and rerun it), i get 0 in %TEMP%\status regardless of the real exit code. What am i missing? Or maybe there's a better way of doing this?

    Read the article

  • Batch break up after call other batch file

    - by Sven Arno Jopen
    i have the problem, that my batch process breaking up each time after call a other batch file. The batch files are used to run a make process out from IBM Rhapsody. There convert the call from Rhapsody to the Visual Studio tools. So nmake will be called from the batch after make different settings. The scripts aren’t written completely from me, I only adapt theme to run under both windows architecture versions, x86 and x64. The first script (vs2005_make.bat) will be called from Rhapsody and run to the “call” statement. The second script (Vcvars_VisualStudio2005.bat) runs to the end. But the first script isn’t resume working, at this point the process break up without a error message. I'm not very familiar with batch files, this is the first time I make more than simple console commands in a batch file. So I hope I have given all information’s which needed, otherwise ask me. Here the start script (vs2005_make.bat): :: parameter 1 - Makefile which should be used :: parameter 2 - The make target mark @echo off IF "%2"=="" set target=all IF "%2"=="all" set target=all IF "%2"=="build" set target=all IF "%2"=="rebuild" set target=clean all IF "%2"=="clean" set target=clean set RegQry="HKLM\Hardware\Description\System\CentralProcessor\0" REG.exe Query %RegQry% > checkOS.txt Find /i "x86" < CheckOS.txt > StringCheck.txt IF %ERRORLEVEL%==0 ( set arch=x86 ) ELSE ( set arch=x64 ) call "%ProgramFiles%\IBM\Rhapsody752\Share\etc\Vcvars_VisualStudio2005.bat" %arch% IF %ERRORLEVEL%==0 ( set makeflags= nmake /nologo /S /F %1 %target% ) del checkOS.txt del StringCheck.txt exit and here the called script (Vcvars_VisualStudio2005.bat): :: param 1 - Processor architecture @echo off ECHO param 1 = %1 IF %1==x86 ( SET ProgrammPath=%ProgramFiles% ) ELSE IF %1==x64 ( SET ProgrammPath=%ProgramFiles(x86)% ) ELSE ( ECHO Unknowen architectur EXIT /B 1 ) SET VSINSTALLDIR="%ProgrammPath%\Microsoft Visual Studio 8\Common7\IDE" SET VCINSTALLDIR="%ProgrammPath%\Microsoft Visual Studio 8" SET FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework SET FrameworkVersion=v2.0.50727 SET FrameworkSDKDir="%ProgrammPath%\Microsoft Visual Studio 8\SDK\v2.0" rem Root of Visual Studio common files. IF %VSINSTALLDIR%=="" GOTO Usage IF %VCINSTALLDIR%=="" SET VCINSTALLDIR=%VSINSTALLDIR% rem rem Root of Visual Studio ide installed files. rem SET DevEnvDir=%VSINSTALLDIR% rem rem Root of Visual C++ installed files. rem SET MSVCDir=%VCINSTALLDIR%\VC SET PATH=%DevEnvDir%;%MSVCDir%\BIN;%VCINSTALLDIR%\Common7\Tools;%VCINSTALLDIR%Common7 \Tools\bin\prerelease;%VCINSTALLDIR%\Common7\Tools\bin;%FrameworkSDKDir%\bin;%FrameworkDir%\%FrameworkVersion%;%PATH%; SET INCLUDE=%MSVCDir%\ATLMFC\INCLUDE;%MSVCDir%\INCLUDE;%MSVCDir%\PlatformSDK\include\gl;%MSVCDir%\PlatformSDK\include;%FrameworkSDKDir%\include;%INCLUDE% SET LIB=%MSVCDir%\ATLMFC\LIB;%MSVCDir%\LIB;%MSVCDir%\PlatformSDK\lib;%FrameworkSDKDir%\lib;%LIB% GOTO end :Usage ECHO. VSINSTALLDIR variable is not set. ECHO. ECHO SYNTAX: %0 GOTO end :end Here the console output, what I not understand here and find very suspicious is that after the “IF %ERRORLEVEL%” Statement in the first script all will be put out regardless the echo is set to off… Executing: "C:\Programme\IBM\Rhapsody752\Share\etc\vs2005_make.bat" Simulation.mak build IF %ERRORLEVEL%==0 ( Mehr? set arch=x86 Mehr? ) ELSE ( Mehr? set arch=x64 Mehr? ) call "%ProgramFiles%\IBM\Rhapsody752\Share\etc\Vcvars_VisualStudio2005.bat" %arch% :: param 1 - Processor architecture @echo off ECHO param 1 = %1 param 1 = x86 IF %1==x86 ( Mehr? SET ProgrammPath=%ProgramFiles% Mehr? ) ELSE IF %1==x64 ( Mehr? SET ProgrammPath=%ProgramFiles(x86)% Mehr? ) ELSE ( Mehr? ECHO Unknowen architectur Mehr? EXIT /B 1 Mehr? ) SET VSINSTALLDIR="%ProgrammPath%\Microsoft Visual Studio 8\Common7\IDE" SET VCINSTALLDIR="%ProgrammPath%\Microsoft Visual Studio 8" SET FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework SET FrameworkVersion=v2.0.50727 SET FrameworkSDKDir="%ProgrammPath%\Microsoft Visual Studio 8\SDK\v2.0" rem Root of Visual Studio common files. IF %VSINSTALLDIR%=="" GOTO Usage IF %VCINSTALLDIR%=="" SET VCINSTALLDIR=%VSINSTALLDIR% rem rem Root of Visual Studio ide installed files. rem SET DevEnvDir=%VSINSTALLDIR% rem rem Root of Visual C++ installed files. rem SET MSVCDir=%VCINSTALLDIR%\VC SET PATH=%DevEnvDir%;%MSVCDir%\BIN;%VCINSTALLDIR%\Common7\Tools;%VCINSTALLDIR%\Common7\Tools\bin\prerelease;%VCINSTALLDIR%\Common7\Tools\bin;%FrameworkSDKDir%\bin;%FrameworkDir%\%FrameworkVersion%;%PATH%; SET INCLUDE=%MSVCDir%\ATLMFC\INCLUDE;%MSVCDir%\INCLUDE;%MSVCDir%\PlatformSDK\include\gl;%MSVCDir%\PlatformSDK\include;%FrameworkSDKDir%\include;%INCLUDE% SET LIB=%MSVCDir%\ATLMFC\LIB;%MSVCDir%\LIB;%MSVCDir%\PlatformSDK\lib;%FrameworkSDKDir%\lib;%LIB% GOTO end Build Done I hope someone have an idea, i work now since two days and don't find the error... thanking you in anticipation. Note: The word “Mehr?” in the text output is german and means “more”. I don't know were it comes from and it is possible that it is a bad translation from the English output to german.

    Read the article

  • Does anyone know how to detect whether a Windows Service is running through Java

    - by GKelly
    There's plenty of information on running Java apps as services, but I need to know how to detect whether a windows service is running or not. Does anyone know how??? At the DOS prompt, I can run: tasklist /svc|findstr "NonRunningService" echo Return code for N onRunningService is %ERRORLEVEL% tasklist /svc|findstr "RunningService" echo Return code for RunningService is %ERRORLEVEL% I get the following: Return code for NonRunningService is 1 Return code for RunningService is 0 In code, I have: int retCode = Runtime.getRuntime.exec("tasklist /svc|findstr \"NonRunningService\"").waitFor(); System.out.println("Return code for NonRunningService is " + retCode); retCode = Runtime.getRuntime.exec("tasklist /svc|findstr \"RunningService\"").waitFor(); System.out.println("Return code for RunningService is " + retCode); I get the following output Return code for NonRunningService is 1 Return code for RunningService is 1 According to the JavaDocs, the waitFor() should block until the process finishes, and give me the exit value of the process. I've also tried using the Process/ProcessBuilder command line calls: //'tasklist /nh /fi "SERVICES eq RunningService"' will return a line for // each running service of the requested type. Process p1 = new ProcessBuilder("tasklist", "/nh", "/fi" "SERVICES eq RunningService").start(); p1.waitFor(); BufferedReader is = new BufferedReader(new InputStreamReader(p1.getInputStream())); String line = is.readLine(); System.out.println("Service - " + line); System.out.println("Running? ", (line==null?"No":"Yes"); gives: Service - Running? No even when I get lines in the output at the command line!

    Read the article

1 2 3  | Next Page >