Script/Program

joshharrington

Senior member
Apr 17, 2005
784
0
0
I don't know much, if any code, but I was wondering if someone could write a program to run an exe (PSLoggedOn in this case), but instead of me modifying the batch file each time, having the program prompt me to enter either a username or password. I think the batch file should look like this:

psloggedon \\computername

-or-

psloggedon username

....and if I open up a command prompt and type psloggedon \\computername *example* I am able to use the program psloggedon. I just want to be able to enter either a.) a username and/or b.) a computername

Thanks guys!
 

WannaFly

Platinum Member
Jan 14, 2003
2,811
1
0
I dont really understand what you are asking, since it'd be a one like batch file:

psloggedon %1

or for it to ask over and over (until you press CTRL-C)
:A
echo %1
goto A
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
whatever the hell "psloggedon" is. I have no idea what you're asking for.

You want to be able to type "psloggedon \\computername" and see what user is logged onto "computername"? is that it? :confused:
 

joshharrington

Senior member
Apr 17, 2005
784
0
0
PSLogged on is part of PSTools. It is a program to see who is logged onto a computer by typing in that computer name or finding the computer they're on by typing the username. What I want is a way to have something come up where I type in either a username or a computername instead of going into the command prompt and typing out the line each time.
 

QED

Diamond Member
Dec 16, 2005
3,428
3
0
Create a .bat file called CallPSLOggedOn.bat.

It should have just two lines in it:

PSLoggedOn %1
pause

Now, create a Shortcut to the batch file on your desktop. Right-click on the short-cut, and choose properties. Under one of the tabs (I'm going from memory here... it's been about 5 years since I've done this), there is an option for MS-DOS paramater options. Put a single question mark here.

Now, when you double click on the shortcut, a dialog box will come up and prompt you for a string. This string will get passed to the batch file, and in turned passed to the PSLoggedOn command.



 

joshharrington

Senior member
Apr 17, 2005
784
0
0
Thanks QED, but I can't seem to find that MS-DOS parameter options, and this is local machine only. Is there a way to get remote machines?
 

QED

Diamond Member
Dec 16, 2005
3,428
3
0
Originally posted by: joshharrington
Thanks QED, but I can't seem to find that MS-DOS parameter options, and this is local machine only. Is there a way to get remote machines?


Sorry... like I said it's been a while. Instead of an MS-DOS paramater option box, is there a box which lists the path to the batch file you are creating the shortcut for?

If so, just put a single question mark after the name of the batch file.

It should look something like this:

Shortcut
 
Aug 1, 2004
77
0
0
Um. If you're on XP or 2k then try attached code...

Insert a pause if you have to. Don't know how your psloggedon works.