logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
llj6Sq  
#1 Posted : Monday, July 23, 2018 12:50:37 PM(UTC)
llj6Sq


Rank: Newbie

Joined: 1/29/2014(UTC)
Posts: 5
United States

I was directed by Support to post this here.

I have self-hosted version 6.4.15083.6507. I have tried issuing the following command to an Access machine, using both the Run Command and Command Toolbox extension. I know the command is correct, because it will run from the WinKey+R run dialog when I'm logged on to the Access computer. The command opens command prompt and then uses File Explorer to navigate to and run an installer program. The command is:

cmd.exe /c "explorer.exe %userprofile%\gsrlc\it\smartshield\SmartShield2.1.13.1224_x64.exe"

I also cannot run this simple command

explorer.exe

though it too will run from the Win+R dialog box when I am logged on to the machine. I am able to run commands like shutdown and restart and others, so I don't understand why I'm having a problem with these two command.
MannyTC  
#2 Posted : Monday, July 23, 2018 3:57:46 PM(UTC)
MannyTC


Rank: Advanced Member

Medals: Bug Buster Level One: Spoon!Level 3: Shirt off your back! Received 25 Thanks!

Joined: 2/19/2015(UTC)
Posts: 260
United States
Location: AZ

Thanks: 8 times
Was thanked: 52 time(s) in 45 post(s)
When you run a command through those areas Windows is running them under the SYSTEM user account which is unaware of the user environment the PC is currently logged in as. So as an example you will not be able to see mapped drives that the user currently has because you are not running the commands as that user. You would need to put in a specific UNC path to access files on network drives. Another thing to remember is you cannot run any applications this way that are 'interactive' because they will not run in the currently logged in user context so the GUI of the application will not display. The only way to run applications is if they have a silent or quiet mode.

In your first example the first issue you will run into is the %userprofile% environmental parameter. This will end up returning 'C:\windows\system32\config\systemprofile' instead of something like 'C:\users\usernamehere'. My guess is that either the .exe you are trying to run cannot be found in 'C:\windows\system32\config\systemprofile\gsrlc\it\smartshield\SmartShield2.1.13.1224_x64.exe' or that application is an interactive application and thus will not be able to display its dialog screens.

The same goes for your second example. You are trying to run explorer.exe as the SYSTEM user which will not do anything in the currently logged in users session.

The best way to describe what commands that can be run are either standard DOS type command prompt commands that do not prompt for anything or any executable (like a setup.exe) that has a quiet or silent install option.

Let me know if you have more questions. I think I posted more examples on this in an old post from years ago if you search for it.
llj6Sq  
#3 Posted : Monday, July 23, 2018 4:18:44 PM(UTC)
llj6Sq


Rank: Newbie

Joined: 1/29/2014(UTC)
Posts: 5
United States

Manny,
Thanks for the response. I think I understand what you're saying, butlet me ask an additional question.

We have Centurion Technologies SmartShield installed on our computers. SmartShield has a mode in which it will launch an application on the client computers from a central controller computer. My command to run the installer works from that central, controller computer when I use this SmartShield feature.

So, are you saying the SmartShield controller is running as the currently logged in username on the client computer and ConnectWise is not?

I will search for your other responses on this topic.

Lowell
promptcare  
#4 Posted : Wednesday, July 25, 2018 7:32:07 PM(UTC)
promptcare


Rank: Advanced Member

Medals: ScreenConnect Advisor: Focus Group MemberLevel 2: Lent a Helping Hand! 10 Thanks!

Joined: 9/14/2011(UTC)
Posts: 357
Location: ON, Canada

Thanks: 31 times
Was thanked: 14 time(s) in 11 post(s)
What he means is that, within ConnectWise command line window, you are interacting with the client as the System account -- anything you run gets run as System which the user doesn't see. Try sending "notepad" as a command line instruction. You'd see that it's running as System but the user won't see it. (Think of System as having its own private/invisible desktop that nobody else sees). Same thing happens when you send commands to run installers -- unless they're silent installers, they'll just sit invisibly in the background waiting for Next to be pressed.

Commands sent by command line must not require interaction from the user. But IF you send files from the Toolbox, THEY are sent as the user so you could put that file in your toolbox and send it over manually (even without opening a windowed connection).
llj6Sq  
#5 Posted : Wednesday, July 25, 2018 8:28:03 PM(UTC)
llj6Sq


Rank: Newbie

Joined: 1/29/2014(UTC)
Posts: 5
United States

Yes, I understand what he's saying. I was just noting that our SmartShield software apparently does run programs as the local users I can connect to our SmartShield Controller computer and using its Start Client Application option, I can select multiple machines, and with the %userprofile% system variable, start the installer files on those machines with one command. I was hoping I could duplicate this with ControlWise, but looks like that's not possible.

I don't think Toolbox will help me here. the installer files reside on my remote computers. While i can access the files from my host, using the toolbox to transfer them to the remote systems will be much more time consuming than actually connecting to the remote systems, navigating to the installer, and running it. Perhaps i could use a .bat/.cmd file, but then i'd have to create such a file for every program I wish to run in this manner. I've also though about using the Runas command, but I'd have to populate a username/password for each remote system, so I don't think thats gonna hel wither, but I may give it a shot.


promptcare  
#6 Posted : Wednesday, July 25, 2018 8:41:48 PM(UTC)
promptcare


Rank: Advanced Member

Medals: ScreenConnect Advisor: Focus Group MemberLevel 2: Lent a Helping Hand! 10 Thanks!

Joined: 9/14/2011(UTC)
Posts: 357
Location: ON, Canada

Thanks: 31 times
Was thanked: 14 time(s) in 11 post(s)
If you created a parallel shortcut pointing to that file and saved it to your Toolbox, that should work. I throw a shortcut to Task Scheduler in mine for easier access and, obviously, it opens their TS and not mine. So long as path is correct, it should work.
llj6Sq  
#7 Posted : Wednesday, July 25, 2018 9:28:23 PM(UTC)
llj6Sq


Rank: Newbie

Joined: 1/29/2014(UTC)
Posts: 5
United States

You jogged my memory. I think I have created some commands or batch files that will enable or disable windows scheduled tasks. Probably use the same principle you've mentioned here. I'll have to look for that. I'll post here if I find it, in case someone else is interested.

Thanks for the reminder.
promptcare  
#8 Posted : Wednesday, July 25, 2018 9:29:34 PM(UTC)
promptcare


Rank: Advanced Member

Medals: ScreenConnect Advisor: Focus Group MemberLevel 2: Lent a Helping Hand! 10 Thanks!

Joined: 9/14/2011(UTC)
Posts: 357
Location: ON, Canada

Thanks: 31 times
Was thanked: 14 time(s) in 11 post(s)
Actually, I just meant a shortcut to "%userprofile%\gsrlc\it\smartshield\SmartShield2.1.13.1224_x64.exe" but whatever works for you. :)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.