Do crash 'popup' windows show when SAS is running in batch? - sas

I have a program I want to run in batch. When running it interactively the code occasionally crashes (still working on figuring out why) and when it does this a popup window shows with the typical memory exception messages.
My question is - If I run the program in batch, will this popup still show? If it does it would prevent the execution of the next jobs until someone closes the window which I want to avoid.
The crash is intermittent and I don't want to break our nightly run by just making the change and seeing what happens. Alternatively, does anyone have code I can use that's guaranteed to cause a crash so that I can test it?
My environment is SAS V9 TS1M2 running on XP Pro.

If you're running in batch mode but running in an interactive Windows session (ie, not running via the scheduler on an account that's not logged in currently), then yes, you will see the popups when SAS.EXE crashes. It will be just like any other program crashing (ie, nothing particularly SAS specific).
If it's running on a 'nightly run' then you should be able to run it non-interactively, in which case it should not affect anything subsequent; this depends on the specifics of how you've set up the scheduler. I would normally schedule each SAS job as a separate process and then set them up as dependent on success of the prior run. You certainly should be able to run a specific process just to test your changes that could be scheduled to run after all of the 'critical' (production) runs.

Related

Can I run a process from my process without becoming its parent?

I have a somewhat strange request. Let me explain. I recently run into an issue when I needed to display my screensaver's configuration window by running the following command:
"C:\Windows\System32\mysvr.scr" /c
The problem is that my parent GUI application that calls it runs with High Mandatory Integrity Level, or S-1-16-12288, and due to this, when I run the following command via CreateProcess API the screensaver configuration (evidently?) tries to communicate with my app and fails because of its high integrity level.
So I'm trying to bypass this by having some other process run this command for me. I looked into possibly using RunDll32 but I don't know an API that I can use through it to start a process.
Any ideas?

Invoking the application as system user(Windows)

We have a native GUI application which runs on a windows machine, and recently we have found out that the application terminates unexpectedly. After days I have found that this is happening because the application is run by explorer.exe and it gets killed unexpectedly, random somehow, so it causes termination of all child processes including our application.
Is there a way to invoke/call our app as system process (not with explorer.exe)?
Also assume that application/user has administrator access too.
Thanks in advance.
Killing explorer does not in general kill other processes. This is very easy to verify yourself by killing explorer from the task manager. Notice that other processes stay alive when you kill explorer. Something else is killing your process.
If killing explorer leads to your process dying, then the obvious explanation is that something in your process is leading to its death. In other words the problem is most likely in your code, and you need to work out what that problem is.
Also note that explorer isn't really a special "system process" as such. It's just a normal process that that runs under the logged on user's token.
You may need to give some hand of a OS services, then run the service as admin(run as system boot), then start he application from the service ,this will ensures you the app will started as admin and without the explorer.exe(as child)

How does one run a program at startup that requires UAC elevation?

I have a program that monitors malicious files and deletes them. However it needs administrator rights to run. This program runs at startup, however the UAC popup is annoying for end users, especially if it appears every time the user logs in. Anyway, I am wondering if there is a way to run the program with administrator rights at startup with out nagging the user with the UAC popup.
P.S: Disabling UAC is not a good idea because of security issues for the users.
You cannot. Windows Vista (thankfully) blocked applications on startup that tried to elevate. Windows 7 removed the block; causing applications to try to do it.
Your best choice is to:
add a Scheduled Task to run your application "At system startup", and have it run "With highest privileges available"

How to Stop A ColdFusion MX-7 Scheduled Task that has already started

I inherited a coldfusion MX7 application that has a long running process, which the user kicked by accident.
By my calculations, at the current rate, the job will run for 3 days.
There doesnt seem to be a way through the administrator interface to stop a job that is running.
The table that is being filled can be easily repopulated, so I would think stopping the coldfusion service wont effect anything except the table, which isnt a problem.
Am I right? Is that safe? Is there another way?
a one-time restart of the service should be fine. for the future, you may want to add a required url param or other such safety mechanism to keep this long process from accidentally going off.
Check to see if the task already has an explicit timeout out set
Explicit Timeout
Otherwise the default page time out is used
Server Settings
For newer versions of ColdFusion 8 and above, you can kill a running page with with the Server Monitor in the section labeled "Aborting unresponsive or troublesome requests/threads"
Using server monitor.
It also may be possible to stop the processing by killing the SQL Server Task:
Is there a task manager of sorts for SQL Server 2008 and on?

Windows 7 UAC elevation

I have a single thread that I'd like to run as an administrator in my application. The rest of the application I can happily run as the default user level (asInvoker). Is this possible? I notice there is an "ImpersonateLoggedOnUser" function. Can I somehow use this to log the administrator on and then get the thread to impersonate that person?
It seems as though this ought to be something pretty trivial to do ... but there doesn't appear to be any obvious way to do it. Can anyone help me out?
Edit: So if I have to fire off a seperate process is there any way I can CreateProcess a new process and have it launch from a specific entry point. I can, of course use command line processing to do it, but i'd really rather I could stop the user from entering the command line and starting an unclosable process!
No, elevation is per process, not thread.
If the rest of the application has to run non-elevated, you could run yourself elevated with some parameter (myapp.exe /uac "ipcparamhere") and use some sort of Inter-process communication to communicate back to the "main instance" of your app. (If the elevated process only performs a simple operation, you could probably check for success by using the exit code of the process)
This is not possible. You'll need to gain admin privileges by including a manifest in the app. Google "requireAdministrator" to find the manifest you'll need. Your user will probably quickly tire of doing this over and over again, your best bet is to spin-off the task that requires these privileges into a separate process. A service for example.
You can launch a separate exe and have a manifest on it saying it requires administrator. Then be sure to launch it with shell execute, which uses manifests, and you're all set. As a thoughtful touch, put a UAC shield on the button that kicks off that thread. (Send it a BCM_SETSHIELD message if you're doing this all by hand.)
You can decided whether you want a visible window or not on the separate process. Meanwhile the user can still drag and drop into the main app.