topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday August 11, 2020, 1:54 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - highend01 [ switch to compact view ]

Pages: [1] 2 3 4 5 6 7next
1
Post New Requests Here / Re: [REQ] VPN Gate OVPN Configs Downloader
« on: January 23, 2020, 11:53 AM »
You have the sourcecode^^

Use a progress bar instead and move the buttons...

2
Use AHK and create a simple GUI for what you need...

3
The .png files you've attached to your previous post are working fine as well.

AHK v1.1.32.00

4
pngs gives error so attached ico files
The three .png files I'm using here are working perfectly fine...

5

#NoEnv
#SingleInstance force
#Persistent

Gosub, Check
SetTimer, Check, 5000
return


Check:
result := Runret("cmd /c netsh wlan show interfaces")
RegExMatch(result, "im)channel\s+:\s*(?P<Channel>\d{1,3})", match)

If (matchChannel >= 1 && matchChannel <= 14)
Menu, Tray, Icon, %A_ScriptDir%\_green.png
Else If (matchChannel >= 34)
Menu, Tray, Icon, %A_ScriptDir%\_red.png
Else
Menu, Tray, Icon, %A_ScriptDir%\_grey.png

return


; http://www.autohotkey.com/board/topic/15455-stdouttovar/page-7
Runret(cmd, params="") {
; Assemble command + parameters
cmd := (params) ? cmd . " " . params : cmd

DllCall("CreatePipe", "Ptr*", hStdInRd , "Ptr*", hStdInWr , "Uint", 0, "Uint", 0)
DllCall("CreatePipe", "Ptr*", hStdOutRd, "Ptr*", hStdOutWr, "Uint", 0, "Uint", 0)
DllCall("SetHandleInformation", "Ptr", hStdInRd , "Uint", 1, "Uint", 1)
DllCall("SetHandleInformation", "Ptr", hStdOutWr, "Uint", 1, "Uint", 1)

; Fill a StartupInfo structure
if A_PtrSize = 4 ; We're on a 32-bit system
{
VarSetCapacity(pi, 16, 0)
sisize := VarSetCapacity(si, 68, 0)
NumPut(sisize,    si,  0, "UInt")
NumPut(0x100,     si, 44, "UInt")
NumPut(hStdInRd , si, 56, "Ptr") ; stdin
NumPut(hStdOutWr, si, 60, "Ptr") ; stdout
NumPut(hStdOutWr, si, 64, "Ptr") ; stderr
}
else if A_PtrSize = 8 ; We're on a 64-bit system
{
VarSetCapacity(pi, 24, 0)
sisize := VarSetCapacity(si, 96, 0)
NumPut(sisize,    si,  0, "UInt")
NumPut(0x100,     si, 60, "UInt")
NumPut(hStdInRd , si, 80, "Ptr") ; stdin
NumPut(hStdOutWr, si, 88, "Ptr") ; stdout
NumPut(hStdOutWr, si, 96, "Ptr") ; stderr
}

DllCall("CreateProcess" , "Uint", 0 ; Application Name
, "Ptr", &cmd ; Command Line
, "Uint", 0 ; Process Attributes
, "Uint", 0 ; Thread Attributes
, "Int", True ; Inherit Handles
, "Uint", 0x08000000 ; Creation Flags (0x08000000 = Suppress console window)
, "Uint", 0 ; Environment
, "Uint", 0 ; Current Directory
, "Ptr", &si ; Startup Info
, "Ptr", &pi) ; Process Information

DllCall("CloseHandle", "Ptr", NumGet(pi, 0))
DllCall("CloseHandle", "Ptr", NumGet(pi, A_PtrSize))
DllCall("CloseHandle", "Ptr", hStdOutWr)
DllCall("CloseHandle", "Ptr", hStdInRd)
DllCall("CloseHandle", "Ptr", hStdInWr)

VarSetCapacity(temp, 4095)
size := 0
Loop
{
result := DllCall("Kernel32.dll\ReadFile", "Uint", hStdOutRd, "Ptr", &temp, "Uint", 4095, "UintP", size, "Uint", 0)
if (result = "0")
break
else
output := output . StrGet(&temp, size, "CP850")
}
DllCall("CloseHandle", "Ptr", hStdOutRd)
return output
}

6
Write a simple .ahk script which executes
netsh wlan show interfaces
and parses the content afterwards.

Regarding capturing the cmd output, e.g.: https://autohotkey.c...5-stdouttovar/page-7

If Channel is 1-14 you're on 2,4 GHz and if it's 36+ (both values depend on country, look at e.g. https://en.wikipedia...(802.11a/h/j/n/ac/ax)
you're on 5 GHz.

~15 lines of code, 3 16x16 px .png / .ico files (e.g. grey = no wifi connection, green = 2.4 GHz, red = 5 GHz, or whatever you'd prefer)...

Works at least on Win 10...

7
General Software Discussion / Re: looking for cheap email hoster
« on: January 13, 2020, 01:24 AM »
www.SneakEmail.com: Sorry, account creation is currently disabled

Are there any other recommendable services like this?

8
set /p snum="Enter Job Number: "
>%snum%.txt echo Job Number is %snum%
start "" notepad %snum%.txt
>>%snum%.txt echo Next line
>>%snum%.txt echo Last line


9
Post New Requests Here / Re: [REQ] VPN Gate OVPN Configs Downloader
« on: December 05, 2019, 04:05 AM »
With a download progress bar...

2019-12-05_110557.png

10
Post New Requests Here / Re: [REQ] VPN Gate OVPN Configs Downloader
« on: December 03, 2019, 06:21 AM »
Not heavily tested but the basics are working...

You're free to modify it, but reference to my user account name here if you do this...

After you've downloaded the servers (via the belonging button), select one or more (via holding shift or ctrl) in the listview and click on the "Save config(s)" button.
You may want to choose a different path via the "Choose" button first, because the C:\ root may not be writable without appropriate permissions...

11
You can't send "keystrokes" over a network, you need to send "messages" (to a program that listens to them on each client pc).
E.g. with https://autohotkey.c...on-of-winsock-tcpip/
If that still works...

12
#NoEnv
#SingleInstance force
SetWorkingDir %A_ScriptDir%
FileEncoding UTF-8
SetBatchLines, -1

drive := "C:\"
file  := "Dummy.txt"
path  := drive . file
text  := "Dummy"


if FileExist(drive) {
    Loop {
        EmptyFile(path)
        FileAppend, % text, % path
    }
}

EmptyFile(file) {
    hFile := DllCall("CreateFile", Str, file, UInt, 0x40000000, UInt, 3, UInt, 0, UInt, 5, UInt, 0, UInt, 0)
    DllCall("CloseHandle", UInt, hFile)
    return hFile > 0 ? 1 : hFile
}

But ofc this empties the file before it gets overwritten...

OpenFile() would impose too many problems (no unicode, no > 128 file path length...)

14
#NoEnv
#SingleInstance force
SetWorkingDir %A_ScriptDir%
FileEncoding UTF-8
SetBatchLines, -1

drive := "C:\"
file  := "Dummy.txt"
path  := drive . file
text  := "Dummy"


if FileExist(drive) {
    Loop {
        if FileExist(path)
            FileDelete, % path
        FileAppend, % text, % path
    }
}

15
Sure, add the stuff from the stackoverflow link. Done.

16
Post New Requests Here / Re: Select Range of Files Via Batch File
« on: April 07, 2019, 11:16 AM »
findstr has a regex mode as well...

17
Who else would like to take the next step?
Maybe... You?

18
Google stopped working (again)?

https://stackoverflo...32-bits-of-precision

Includes ways how to circumvent this restriction. Have fun learning a minimal amount of batch scripting!

19
You are kidding me, right?

That's the exact same thing, only in green...

@SETLOCAL EnableDelayedExpansion
@ECHO OFF

REM 1 MB = 1048576 bytes
REM 157286400 = 150 MB
SET Max=157286400
SET Src=R:\tst_src
SET Dst=R:\tst_dst

IF EXIST "%Src%" (
    IF EXIST "%Dst%" (
        SET /a Size = 0
        FOR %%I IN ("%Src%\*") DO (
            SET /a Size += %%~zI
            IF !Size! GTR %Max% GOTO :EOF
            MOVE /Y "%%I" "%Dst%" >NUL 2>NUL
        )
    )
)

20
Use the last batch file I wrote and count up their size instead of count?

21
@SETLOCAL EnableDelayedExpansion
@ECHO OFF

SET Max=10
SET Src=R:\a
SET Dst=R:\b

IF EXIST "%Src%" (
    IF EXIST "%Dst%" (
        SET /a Count = 1
        FOR /D %%I IN ("%Src%\*") DO (
            MOVE /Y "%%I" "%Dst%" >NUL 2>NUL
            IF !Count! == %Max% GOTO :EOF
            SET /a Count += 1
        )
    )
)

22
Write an .ahk script (and compile it), that removes all hyphens and line breaks with a single regex replace?

#NoEnv
#SingleInstance Force

^+-:: ; Ctrl+Shift+-
Clipboard := RegExReplace(Clipboard, "(-+)?\r?\n")

23
Coding Snacks / Re: contextmenu addon feature (alike LevelZap)
« on: March 08, 2019, 08:07 AM »
Total Commander > search > search for TTF ; when found > feed to listbox > select all > move to 'dir'
What an effort...

XYplorer: Right click the folder, from the context menu: "Flatten folder", done...

24
A minor update (fixed a problem with the prune button (disabled or not when no results are found) and with the height of the string + button gadgets at the top)...


25
This version can "prune" (delete only the files with the smallest size and keep the one with the largest size) for each found folder...

Apart from that, the window is now resizable, and System Volume Information and $RECYCLE.BIN folders are now left out by default...

Use with care, you aren't asked if you're sure when you click the prune button^^
When the pruning is done, a log with all deleted files is copied to clipboard automatically...

Pages: [1] 2 3 4 5 6 7next