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,933 of 42,547    |
|    Daniel to Daniel    |
|    Re: Question about powershellscript to b    |
|    22 Apr 14 21:25:58    |
   
   From: daniel-r@gmx.net   
      
   Hy Foxidrive..   
      
   Yes, i want to toggle the wlan Device.   
      
   With your batch, i get it disabled but not enabled if its disabled.   
      
   Regards Daniel   
      
      
   "foxidrive" schrieb im Newsbeitrag   
   news:5356692c$0$8078$c3e8da3$3304c218@news.astraweb.com...   
      
   On 22/04/2014 21:57, Daniel wrote:   
   > Hy Folks ..   
   > I have this powershellscript an need this via batch programming.   
   >   
   >   
   > $devid = "*DEV_4236"   
   > $status = devcon status $devid | Select-String "running"   
   > if($status -eq $null)   
   > {   
   > write-host "Enabling wireless"   
   > devcon enable $devid   
   > }   
   > else   
   > {   
   > write-host "Disabling wireless"   
   > devcon disable $devid   
   > }   
   >   
   >   
   > Devcon is a substitute for the windows internal device manager.   
   >   
   > With this microsoft programm i can switch devices via commandline.   
   >   
   > I want to switch the wlan device by this script.   
   >   
   > If status said, xxxxxxxxxxxxxxxxxxxxxxxxxxxx something...... "running"   
   >   
   > The command is "devcon disable "*DEV_4236""   
   >   
   > if not running, the command is "devcon enable "*DEV_4236""   
   >   
   > how can i do this by batch ?   
   >   
   > Regards   
   >   
      
   Do you want to toggle the device? Test this:   
      
      
   @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