ShadowThief wrote:Weird.
I believe I talked to Foxidrive about this already. Windows 8 and above no longer require admin privileges.
Moderator: DosItHelp
ShadowThief wrote:Weird.
Squashman wrote:Windows 8 and above no longer require admin privileges.
Code: Select all
@echo off
setlocal EnableDelayedExpansion
if %~z1 GEQ 74472448 (echo Input file too large ^> 72MB & pause & exit /b)
:ARGLOOP
set outfile="%~dp1\%~n1_Packed.bat"
if %1.==. goto :EOF
call :PACK %1
shift /1
goto :ARGLOOP
:PACK
echo Packing %~nx1
echo.
certutil -encode "%~1" b64
echo Writing datablock to %outfile%...
( echo @echo off
echo :: %~nx1
set/p=(echo.<NUL
for /F "tokens=* delims=" %%A in ('findstr /v " CERTIFICATE-----$" b64') do (
if !count! GEQ 127 set count=0 & echo.& set/p=echo.<NUL
set /a count+=1
set/p=%%A<NUL
)
echo.
echo ^)^>tmp_
echo certutil -decode -f tmp_ "%~nx1"
echo del /q/f tmp_
)>>%outfile%
del /q/f b64
echo.
GOTO :EOF
Code: Select all
certutil -encode input.exe b64
set -=-
for /l %%i in (1,1,7) do set -=!-! !-!
findstr /v " CERTIFICATE-----$" b64 | %tmp%\paste !-!d\0 > b64.txt
JeffryDenn wrote:It really seems like everybody tries a script like this at some point prior to finding this forum. I'd post mine but it doesn't really offer anything new other than support for multiple files and directories.
I found that typically I got better performance by packing executables with UPX before encoding with certutil rather than compressing as a cab.
I'm also fond of compacting the certutil output to fewer lines. Why leave each line to 64 characters wide when encoding 8kb per line works just fine:
Code: Select all
if "%~1" == "" (
echo:EMPTY VALUE
) else (
set /a "val=%~1" 2>nul
if "%val%" == "%~1" (
echo:NUMBER: [%~1]
) else (
echo:NOT A NUMBER: [%~1]
)
)
siberia-man wrote:numcheck.bat: do it easierCode: Select all
if "%~1" == "" (
echo:EMPTY VALUE
) else (
set /a "val=%~1" 2>nul
if "%val%" == "%~1" (
echo:NUMBER: [%~1]
) else (
echo:NOT A NUMBER: [%~1]
)
)
JeffryDenn wrote:It's in reference to other code in the github linked in the first post.
JeffryDenn wrote:(that solution also limits input to natural numbers no more than the 32bit integer ceiling (2147483647) and fails for numbers prefixed by 0)
siberia-man wrote:Sorry, if I posted the message in wrong thread. I have thought this is discussion about the BatFramework.
siberia-man wrote:And, yes. Confirm that my example has a bug as it was mentioned early. The better way is to escape extra parentheses.
foxidrive wrote:I can't help but smile when guys are talking about a 64KB batch file (and trying to shave a few Kbytes off it) ... which transfers by email in the blink-of-an-eye these days.
I remember downloading programs on a BBS and using on a 14400 dialup modem. And that was blindingly fast compared to a 300 Baud acoustic coupler.
It was easy to have a cup of coffee and a meal by the time your program downloaded.
Squashman wrote:And we were all happier then pigs in shit when 28K modems came out.