This is driving me balmy.
I'm using the jShell library to do some wifi massaging on a Windows 10 PC, one code snippet is:
If the variable wrk_interface contains no blanks (e.g. "Wi-Fi") then all works fine.
If the variable wrk_interface contains a blank (e.g. "Wi-Fi 4") then it dies with message:
If I try putting in double quotes like:
wrk_args.Add("netsh wlan disconnect interface=""" & wrk_interface & """ > d:\Swamp\BufferFTPClient-WiFi-Disconnect.txt")
then it dies with message:
I've scoured the forums for the last 2 hours and didn't find anything that worked.
Any pointers to the probably incredibly stupid thing I am/am not doing greatly appreciated...
I'm using the jShell library to do some wifi massaging on a Windows 10 PC, one code snippet is:
B4X:
Private wrk_sh As Shell
Private wrk_args As List
wrk_args.Initialize
'Set up shell to disconnect WiFi interface on PC
wrk_args.Add("/c")
wrk_args.Add("netsh wlan disconnect interface=" & wrk_interface & " > d:\Swamp\BufferFTPClient-WiFi-Disconnect.txt")
wrk_sh.Initialize("Event_shell2", "cmd.exe", wrk_args)
wrk_sh.Run(10000)
If the variable wrk_interface contains a blank (e.g. "Wi-Fi 4") then it dies with message:
One or more parameters for the command are not correct or missing.
Usage: disconnect [[interface=]<string>]
Parameters:
Tag Value
interface - Name of the interface from which disconnection is
attempted.
Remarks:
Disconnect from the wireless network on the specified interface.
Parameter interface is required if there are two or more available
interfaces on the system. Wildcard characters can be used in the
interface name to specify multiple interfaces.
Examples:
disconnect
disconnect interface="Wireless Network Connection"
If I try putting in double quotes like:
wrk_args.Add("netsh wlan disconnect interface=""" & wrk_interface & """ > d:\Swamp\BufferFTPClient-WiFi-Disconnect.txt")
then it dies with message:
Error after shell wait (WiFi Disconnect)...
Success: true
ExitCode: 1
StdOut:
StdErr: ''netsh' is not recognized as an internal or external command,
operable program or batch file.
I've scoured the forums for the last 2 hours and didn't find anything that worked.
Any pointers to the probably incredibly stupid thing I am/am not doing greatly appreciated...
Last edited: