Get Username of Computer

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

shawny2005

Get Username of Computer

Post by shawny2005 »

Hey guys, I'm trying to write a script that will get the name of the computer the script is run on.

For instance, I have 4 different computers, and I want to have a script that writes to a text file to a centralized location (like a db) and records the name of the computer that it was written from.

At this point it looks like my only option is to create a file on the desktop when the script is run, grab the path, and delete the file. (since the name of the computer is included in the desktop path eg: /c/users/shawn/desktop) This seems backwards in the sense that it creates a file everytime the script runs to just delete it, but I can't seem to come up with any other solution. Anybody have an answer?

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

Mike Hale

Get Username of Computer

Post by Mike Hale »

You don't have to create a file on the desktop then delete.

var userName = Folder('~').fsName.match(/[^\\]+$/);