Exit Posted July 13, 2015 Share Posted July 13, 2015 Since BAT/CMD scripts have become a real scripting language, there should be also a subforum in the Language Specific Discussion forum. Just to prove the power of BAT scripts, here a licence key script. I know there is also a working au3 solution.@echo offcall :LicenseKeys >"%Temp%\~~%~n0.txt""%Temp%\~~%~n0.txt"erase "%Temp%\~~%~n0.txt"goto :eof:LicenseKeyssetlocal enabledelayedexpansionfor /f "tokens=1,2*" %%i in ('reg query "HKLM\SOFTWARE\Microsoft" /reg:64 /s /v DigitalProductId ^&^& reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft" /reg:64 /s /v DigitalProductId') do ( set t=%%i set t=!t:~0,5! if .!t!. == .HKEY_. (echo. call :ProductInfo "%%i %%j %%k"))goto :eof:ProductInfo setlocal enabledelayedexpansion set FunctionName=%~0 echo RegistryName=%~1 for /f "tokens=1,2*" %%i in ('reg query "%~1" /v *Product* /reg:64') do ( if %%i==ProductName (echo ProductName: %%k) if %%i==ProductId (echo ProductId: %%k) if %%i==ProductID (echo ProductID: %%k) if /I %%i==DigitalProductId (call :ProductKey "%%k" echo ProductKey: !ProductKey!)) goto :eof:ProductKey setlocal enabledelayedexpansion set FunctionName=%~0 set RegData=%~1 set Validchars=BCDFGHJKMPQRTVWXY2346789 if .%RegData:~0,2%. == .A4. set HexString=%RegData:~104,30% if .%RegData:~0,2%. == .F8. set HexString=%RegData:~1616,30% for /l %%i in (0,2,28) do (set /a j=%%i/2 set /a StringArray[!j!]=0x!HexString:~%%i,2!) set /a "IsWin8=(StringArray[14] & 8)/8" set /a "StringArray[14]=StringArray[14] - !IsWin8! * 8" for /l %%i in (0,1,24) do (set value=0 for /l %%j in (14,-1,0) do (set /a value=StringArray[%%j] + !value! * 256 set /a StringArray[%%j]="( !value! / 24 ) & 255" set /a value%%=24 set /a Win8Pos=!value!) for %%j in (!value!) do set key=!Validchars:~%%j,1!!key!) If %IsWin8% == 1 (set /A "Win8Pos1=24-Win8Pos" set Win8Pos1=-!Win8Pos1! call set t1=%%key:~1,!Win8Pos!%% call set t2=%%key:~!Win8Pos1!%% set key=!t1!N!t2!) endlocal & set %FunctionName:~1%=%key:~0,5%-%key:~5,5%-%key:~10,5%-%key:~15,5%-%key:~20,5% goto :eofMay we convince the admins to create such a subforum ? Skysnake 1 App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
guinness Posted July 13, 2015 Share Posted July 13, 2015 (edited) Isn't PowerShell really meant to be replacing batch scripting? Edited July 13, 2015 by guinness Typo UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
JohnOne Posted July 13, 2015 Share Posted July 13, 2015 There are tons of languages, I'd really hate to see the all listed. minxomat and BrewManNH 2 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Exit Posted July 13, 2015 Author Share Posted July 13, 2015 Isn't PowerShell really meant to be replacing batch scripting?Due to the default execution policy 'restriced', it is hard to execute PS-scrpts on other PCs.But we might expand the powershell forum to also handle BAT and CMD ? App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
guinness Posted July 13, 2015 Share Posted July 13, 2015 I would add there, as it's kind of related. I agree with @JohnOne that we don't need a sub forum for every language. I would like Java and PHP there, but am fine with C# too. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Administrators Jon Posted July 13, 2015 Administrators Share Posted July 13, 2015 (edited) Due to the default execution policy 'restriced', it is hard to execute PS-scrpts on other PCs.But we might expand the powershell forum to also handle BAT and CMD ?If you run it like "powershell.exe -ExecutionPolicy Bypass -File myscript.ps1" then it works fine. The idea was to just have the new common sexy(!) IT admin focused languages explicitly listed. Everything else can go in the general dev forum unless it warrants its own forum. Edited July 13, 2015 by Jon jvanegmond 1 Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
UEZ Posted July 13, 2015 Share Posted July 13, 2015 I would suggest to add Assembler to the list because there are plenty of inline Assembler routines which are useful. Thanks. Xandy 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Skysnake Posted August 14, 2015 Share Posted August 14, 2015 I like this idea. And, bear in mind that bat and cmd is very close to origins of AutoIt. GUIs are pretty and probably a whole issue all by themselves Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
JohnOne Posted August 14, 2015 Share Posted August 14, 2015 The idea, is now reality. Skysnake 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
TheDcoder Posted August 14, 2015 Share Posted August 14, 2015 I say remove all the sub-forums & use tags instead, this way we can post questions for any language, TD EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
Administrators Jon Posted August 14, 2015 Administrators Share Posted August 14, 2015 The search system breaks when you start trying to limit on tags so searching by forum is the best way at the mo. Hopefully upcoming search changes will address problems like this. minxomat 1 Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
TheDcoder Posted August 14, 2015 Share Posted August 14, 2015 @Jon Oh , I rarely use the search JohnOne 1 EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 14, 2015 Moderators Share Posted August 14, 2015 Yes, we are aware JohnOne, BrewManNH and Jon 3 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
JohnOne Posted August 14, 2015 Share Posted August 14, 2015 Xandy and Jon 2 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
kcvinu Posted August 15, 2015 Share Posted August 15, 2015 But learners and newbies are usually using search. Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only) Link to comment Share on other sites More sharing options...
TheDcoder Posted August 15, 2015 Share Posted August 15, 2015 Yes, we are aware Stop teasing me EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 15, 2015 Moderators Share Posted August 15, 2015 I'd have to start, first "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
TheDcoder Posted August 15, 2015 Share Posted August 15, 2015 @JLogan3o13 I thought that you were teasing me because I ***used to*** ask questions without searching the forums EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now