in reply to ID of current process (Windows)

Yes, your perl script will run under the same user account as your batch file. To get the username, you can use $ENV{USERDOMAIN} and $ENV{USERNAME} or Win32::LoginName()