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 40,943 of 42,547    |
|    Daniel to Daniel    |
|    Re: Question about powershellscript to b    |
|    23 Apr 14 11:02:52    |
      From: daniel-r@gmx.net              Nope .. only once it works..                     These are the complete outputs with devcon status                     PCI\VEN_14E4&DEV_4315&SUBSYS_E003105B&REV_01\4&1A6B52AB&0&00E1        Name: Broadcom 802.11g Network Adapter        Driver is running.       1 matching device(s) found.              and              PCI\VEN_14E4&DEV_4315&SUBSYS_E003105B&REV_01\4&1A6B52AB&0&00E1        Name: Broadcom 802.11g Network Adapter        Device is disabled.       1 matching device(s) found.                     Only the first Line in batch will be interpreted.. if i switch the lines ,       the first one ever will work                                   "foxidrive" schrieb im Newsbeitrag       news:53576f0b$0$44169$c3e8da3$38634283@news.astraweb.com...              On 23/04/2014 17:24, Daniel wrote:       > "foxidrive" schrieb im Newsbeitrag       > news:53573208$0$8093$c3e8da3$3304c218@news.astraweb.com...       >       > On 23/04/2014 07:34, Daniel wrote:       >> The output was :       >> "Driver is running."       >> if its enabled or       >> "Device is disabled."       >>       >> if not       >>       >> In the Script the question was , if there is "running" its on an must be       >> disabled, if no "running" there, its disabled and must be enabled.       >>       >       > That is what the code is meant to do, and should work if there is no       > "running" in the output when it       > is disabled.       >       > Test the sample code below and see if it disables, and then enables, the       > wlan.       >       >       > @echo off       > devcon disable "*DEV_4236"       > pause       > devcon status "*DEV_4236" |find /i "running" || devcon enable "*DEV_4236"       > &       > pause & goto :EOF       >              > That works..       >                     Then the code I presented in the first reply will/should work. Did you       include the & goto :EOF at       the end of each line?              The batch file is only three lines.               @echo off        devcon status "*DEV_4236" |find /i "running" >nul && devcon disable       "*DEV_4236" & goto :EOF        devcon status "*DEV_4236" |find /i "running" >nul || devcon enable       "*DEV_4236" & goto :EOF              --- 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