This is a batch file (BAT) used for printing message with Memobird (咕咕机) in windows when the logged in/out to Windows.
-
Register your developer account at https://open.memobird.cn/ and obtain your access key (AK)
-
Obtain your Memobird ID by double-clicking the button on your device. The ID will print out automatically.
-
Bind your account using HTTP POST to http://open.memobird.cn/home/setuserbind
The data send should contains:
"ak" = "Your access key", "memobirdID" = "Your memobird ID", "useridentifying" = "An arbitrary nickname"
You should get the message returned containing you userID (a digital string)
-
Apply the POST parameters to batch file.
Where,
AAA = Your access key
obtained in Step 1,BBB = Your memobird ID
obtained in Step 2 andCCC = Your userID
Obtained in Step 3.curl -d "ak=AAA&printcontent=%Msg%&memobirdID=BBB&userID=CCC" -X POST http://open.memobird.cn/home/printpaper
It should be noticed that, when adding bat file to Start Up
folder or the user configurations, indirectly referencing other files might fail. So it is strongly recommended to directly reference base64.bat
.
Please change the directory of base64.bat
in the scripts line 6&7 before using it.
Use Win+R
and open gpedit.msc
, the Local Group Policy Editor.
Under Computer Configuration / Windows Settings
you'll find Scripts (Startup/Shutdown)
Under User Configuration / Windows Settings
you'll find Scripts (Logon/Logoff)
Then you can add the scripts.
If you are not using a Pro version Windows, you may use the methods below to add the batch file to the start-up folder.
Use Win+R
and open shell:startup
, the Start-up folder.
Copy the BAT file to the folder opened.
Start
-> Programs
or All Programs
->Start Up
->Right click and open folder.
Copy the BAT file to the folder opened.
-
For Memobird API, please check Memobird API document
-
For tutorials adding scripts, please check How can I start a batch script before logging in?
-
For Base64 Encode batch file, please check base64.bat