You can create a file anyway you want. You just want to follow a certain format, which is easiest by copying an existing file that has the lock command. You also need to figure out the network code to put in.
I haven't done it myself, but I know of many users in China who locked their phones inadvertently using custpacks with the lock command.
The code should work with other models that have the customize.xml , I would imagine.