Sunday, May 19, 2013
   
Text Size
Login

Determine if a program is run by another user

Why?
During a critical business period, we monitor the use of a program which only one user can be using at a time. We encountered the issue where the user who would go in to check for any errors, would forget to tell everyone else that they are no longer using the program when they are done.

What?
The program is on a server to which our standard credentials cannot use the "OPENFILES" command on the server to determine who is using a specific program. We wanted IT staff to be able to check for this without disrupting other staff, all our IT staff are admins on standard workstations.

How?
We don't have access to the server but what we do have is admin access to the workstations connected to that server. In order for the following to work, we had to pass the following criteria:
  • Administrator rights on remote workstation.
  • Need to know the computer name or IP address of the remote workstation.

Open a command prompt

  1.  tasklist /s <computername> 

Prefix Line Numbers in a Text File

Intro
Prefixing lines with their respective line number in a text file using a Microsoft Windows Operating System... I've just googled this as I couldn't remember how I did this last time and a number of people showing off their MS-DOS batch skills have proposed stupid extensive solutions when all you need is one command-line.


Why?
Working with programming languages, I often need to write the accompanying documentation. Within the documentation, I may want to refer to a line of code within a text file. I also find myself copying amounts of code into the same document and then needing lines prefixed so that I can explain the code.


What?
Change contents of "original_file.txt"

  1.  The first line of my code 
  2.  The second line of my code 
  3.  The third line of my code 
To "results_file.txt"

  1.  1:  The first line of my code 
  2.    2:  The second line of my code 
  3.    3:  The third line of my code 


How?

Add "Command prompt from here" to right-click context menu

Applies to:
  • Microsoft Windows XP
How?
 I keep having to do this every year as I reghost all my machines (=restore to sorta factory settings), so instead of googling it and going through other websites that work and don't; I thought I might as well post the way I do it:

  1. Open up windows explorer
  2. Go to Tools -> Folder Options
  3. Click on the File Types tab
  4. Scroll down and select (NONE) Folder as file type
  5. Click on Advanced
  6. Click on New...
  7. For the Action type what ever you want the context menu to display, I use Command prompt from here
  8. For the Application value type c:\windows\system32\cmd.exe (this will be different on winnt, browse if unsure to your cmd.exe program)
  9. Click on OK > OK > Close

Notes:
  • Added by default since Microsoft Windows 7

Latest Posts

  • Joes Revolver Map (JRM)

    • Fri 17-May-13
      Hmmm... Sounds like a problem with the identifier. Was it working before and has there been a change ...
      Joel Lipman  
    • Fri 17-May-13
      Hello Joel: Yes, I do have it published on all pages of the site. I just went back to Revolver maps to ...
      Bill Duncan  
    • Fri 17-May-13
      Hi Bill, From the developers of RevolverMaps, "the module would need to be published on every page ...
      Joel Lipman  
    • Fri 17-May-13
      Hi Bill, I'll investigate further as you're not the first to say this happens. In the meantime, simply ...
      Joel Lipman  
    • Fri 17-May-13
      Its a great extension. But when I set it up I only show my presence on the 3D map and no other visitors ...
      Bill Duncan