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,938 of 42,547    |
|    foxidrive to Daniel    |
|    Re: Question about powershellscript to b    |
|    23 Apr 14 17:43:05    |
      From: foxidrive@server.invalid              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