Page 1 of 1

Remote execution of application interactively Win 7

PostPosted: Sat Jan 24, 2015 5:18 pm
by As1401
Hi Neosoft,

I have a function that allowed the remote execution of an app with the current logged on user.
Worked fine in XP, however because of the additional security in Win 7, runs hidden. It is a countdown screen that countdowns from 2.0 minutes, then auto reboots that system. It also has a "Abort reboot" button that the user can press if they are doing work.

Function is:

strComputer = "[%1]"
strCommand = """c:\Program Files (x86)\EWR\EWR_Client.exe"""

Const INTERVAL = "n"
Const MINUTES = 1

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objScheduledJob = objWMIService.Get("Win32_ScheduledJob")
Set objSWbemDateTime = CreateObject("WbemScripting.SWbemDateTime")

objSWbemDateTime.SetVarDate(DateAdd(INTERVAL, MINUTES, Now()))
errReturn = objScheduledJob.Create(strCommand, objSWbemDateTime.Value, False, 0, 0, True, intJobID)

If errReturn = 0 Then
'Wscript.Echo "notepad.exe was started with a process ID: " & intJobID
Else
'Wscript.Echo "notepad.exe could not be started due to error: " & errReturn
End If


This basically sets up an AT job on the remote PC to run in 1 minute. It does'nt run interactively in Win 7.
I have tried using Schtasks as well, but that doesn't work interactively.Starts it's own session.

Is there a way around this?

Kind regards,

Alan Soper

Re: Remote execution of application interactively Win 7

PostPosted: Mon Jan 26, 2015 11:24 am
by Neosoft Support
I'm sorry, I don't have an answer for you. You might be able to tweak the Windows 7 security policy to allow your program to work.

This Google search may help:

https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=windows%207%20security%20poilicy%20allow%20reboot

Re: Remote execution of application interactively Win 7

PostPosted: Mon Feb 02, 2015 4:44 pm
by As1401
Hi Neosoft,

Searched high and low for an answer. Didn't want to use PSEXEC.
Finally came up with a workable solution, which runs great. :D

Eltima's "Application as Service", http://www.eltima.com.

Install new service to remote PC or build image. Configure service to be manual and run interactively.
Then can send a SC command in hidden dos prompt window from controlling PC like so "SC remotePC start myservice", pops up the executable interactively. :lol:
Worth the money as an investment!!

Thought I'd share this with the other users who may need to do the same thing.

kind regards,

Alan S

Re: Remote execution of application interactively Win 7

PostPosted: Tue Feb 03, 2015 11:42 am
by Neosoft Support
I'm glad you found a solution. Thank you for sharing it with us.