windows 2003 doesn't open cmd as "interact with desktop" when using scheduled tasks - windows

i have two windows servers : windows server 2003 and windows server 2008.
in windows 2008 when i start a batch script through scheduled task,
it opens a visible CMD window with my batch on it.
in windows 2003 on the other hand when i start a batch script through scheduled task,
it doesn't open a visible CMD window (interact with desktop not available?) but i can see the process of the batch running in the background.
does anyone knows how can i activate the Desktop? so i can see the CMD open
Thanks :)

so i found the solution. there were two thing i had to do:
A- check the checkbox for "Run only if logged in" in the task itself.
B- enable "Allow service to interact with desktop" on the task scheduler service.
1.)Click Start, click Control Panel, and then double-click Administrative Tools.
2.)Click Computer Management.
3.)Expand Services and Applications, and then click Services.
4.)Right-click the Task Scheduler service, and then click Properties.
5.)On the General tab, make sure that the startup type is set to automatic, and that the service status is Started. If the service is not running, click Start.
6.)On the Log On tab, make sure that the local system account is selected, and that the Allow service to interact with desktop check box has a check mark.
7.)Click OK, and then quit Computer Management.

Related

Launch my application before the Windows logon screen

In a personal project, I want to display my application before (or above) the Windows Logon, ie just before entering the Windows password.
The application must "hide" the password entry screen. I used to launch an application at Windows startup but this after viewing the Windows desktop.
Is it possible to do this please? Should I create a Windows service that will launch my application?
Thanks for your help
If this is just a personal project on your own machine you could set Windows to autologon and then just run your application like a normal startup shortcut.
A NT service is the only documented way to run code before a user logs on. However, spawning a new process in another session and interacting with the Winlogon desktop and putting yourself on top of LogonUI.exe is going to be a hack.

opened dialog window in windows service

I am running some Windows application as a service. This application used Office applications(Word, Excel). The service runs under specific user account.
Here is the problem:
When service is trying to use Excel, Excel is showing some dialog window which blocks the application from running. Since it's a service running in noninteractive mode you are not able to see the dialog window.
I was wondering if there is a way to get the title of a dialog window to understand the root cause of it.
I tried using EnumDesktopWindows but it didnt help.
Platform: Windows 10.
Thanks

Why application that require administrative privileges cannot run automatically on Windows startup(windows 7)?

I have a application(which runs on windows7 and requires run as administrative) that need to run automatically when windows starts up, so i added a registry key under "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" as usual, but my application won't startup automatically even the UAC dialog doesn't promtp, after search from google. I know i can use task scheduler to workaround this, but is there anyboday can tell me why the "run" registry way doesn't work? why the UAC dialog doesn't promtp? it is better if you can help to find a article from microsoft to explain this issue, many thanks in advance!
It is for making the machine usable as quick as possible after booting.
Microsoft Whitepaper: Developing Applications that Run at Logon on Windows Vista
When Windows starts, there is no user to show the UAC prompt to, so your process would have to be held up until an administrative user logs in.
The Task Scheduler is the right way to do what you want.

Task bar icons missing

I have tried to install a shell DLL in Windows7 using innosetup (installation script). To apply the shell changes I have restarted the explorer by using batch file (during installation).
It seems working on WindowsXP and Windows2003 without any issue. But in Windows7 once the explorer restarted all the taskbar icons like skype, google talk,.. (except Network and Audio icons) are closed. But all those applications are running fine. Even I click on the particular application (say skype) in start menu, it wont appear on taskbar. Only way is, need to stop the application in taskbar and again start it.
Is there any way to fix this.
Note:
I am running the installer with admin rights. Also I have tried to run the following commands in Windows7 'Administrator Command Prompt' to restart the explorer.
taskkill /f /im explorer.exe
explorer.exe
The same results happen. All the icons are closed in taskbar. But if I start the explorer via taskmanager this issue wont occur.
Note sure whether it is related to my installation setup (the same commands I am using in my batch file and used to run during installation)
Is there any way to fix this issue.?? I want to install without closing the taskbar icons..
Is it possible that your icon is in the overflow area? Click on the little "uparrow" chevron on the left of the notification area and see if your icon is in there.

How to turn off McAfee programmatically

I am running McAfee VirusScan Enterprise 8.7i on my Windows 7 machine.
I am writing this utility to configure McAfee. Now how do I turn off McAfee programmatically (using C++ or C#)?
The only ways I can do it right now are:
Manually opening the McAfee Virusshield icon from the system tray and then selecting Exit.
Run a command prompt under SYSTEM account (using System internals tool psexec) and then issue the command "sc stop McShield"
I guess the point of virus scanners is that they CANNOT be switched off by other software (at least not easily)
Right click on the VShield icon in the system tray and choose Manage features and the VirusScan Enterprise
Double click on Access Protection to get to the properties
Un-check the option for "Prevent McAfee services from being stopped"
You should now be able to stop the McAfee services

Resources