I want to know .exe file is getting properly launched or not?
I want a wrapper(in LabVIEW) to check whether the launching is done successfully or not.
Thanks in Advance:)
You can use SysExec.vi to launch other applications from LabVIEW. You can refer this link
Then again use SysExec.vi with the command "cmd /c tasklist" to get the active application list. From the standard output you can find the target application.
Related
I want to kill RunDll32 process which is started from my install directory.
So if I use
${nsProcess::KillProcess} "rundll32.exe" $R0
It kills all the rundll32 processes on the system which I don't want to happen.
IMO, I have two options to fix this,
1. Identify interested process from commandline parameters
2. Identify from process startup directory (current directory).
I see there are few plugins to find the process but what they do is they just return found or not found. Instead I want IDs of the processes or list of these processes and then I'll check each process for command line or startup directory information and will act on the the required process.
BTW, I checked following plugins
http://nsis.sourceforge.net/FindProcDLL_plug-in
http://nsis.sourceforge.net/Processes_plug-in
http://forums.winamp.com/showthread.php?t=230998
Thanks
I fixed by using wmic query as follows:
StrCpy $1 "wmic Path win32_process where $\"name like 'Rundll32.exe' and CommandLine like '%$0%'$\" Call Terminate"
nsExec::Exec $1
If you control the .dll then the best option is to provide some sort of way to shutdown the app in a clean way. Perhaps you could find a window based on its class name and send it a WM_CLOSE message.
If you just need to shutdown the application during upgrade/uninstall then the LockedList plug-in is much better than just killing processes...
I have a program I wrote in Visual Basic Express 2013 to put a classification banner at the top of the screen. I set up a scheduled task using ngen.exe which makes it run at login. The problem is that it doesn't run as admin so any non-privileged user can kill the task.
This program is to replace another program called Netbanner because there are a few issues with Netbanner. The program I wrote resolves all of these issues except for the admin issue. Netbanner is implemented exactly the same way (ngen.exe) but it won't let a non-privileged user kill the task.
I don't know if it is something in the program itself or I missed something in the deployment process.
This is the command used to deploy Netbanner which I duplicated to deploy mine:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe install "C:\Program Files\Microsoft\NetBanner\NetBanner.exe"
Also, these are the files in C:\Program Files\Microsoft\NetBanner:
NetBanner.exe
NetBanner.InstallState
NetBanner.pdb
NetBannerSchTask.xml
Any ideas?
Thanks.
You could try to go into the properties->Compatibility->Run this program as an administrator for the application.
Alternatively, you could do the same thing for a batch file that you can schedule to run on startup.
I want to send messages withing a windows 7 LAN using VB.NET code. The problem is that the msg.exe executes commands in admin mode only. Here is the code.
Shell("cmd.exe /k runas /user:farook-pc\administrator msg.exe") 'Here i'm prompted for a password.
Shell("cmd.exe /k msg.exe", 1)
I use the /k switch to see what's going on in the shell. /c is the silent switch. I do not wish to use runas neither do I wish to change privilages in msg.exe
I hate launching other apps and trying to control them like that. If possible, I would recommend trying to mimic the functionality of msg.exe, yourself, programatically. From doing a few quick google searches, I found that the API function that msg.exe uses is apparently WTSSendMessage in Wtsapi32.dll. Here's the MSDN article on that function:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383842(v=vs.85).aspx
And here's a link that shows how to invoke that API function from .NET:
http://www.pinvoke.net/default.aspx/wtsapi32/wtssendmessage.html
I've never used it before, or even heard of it before, so, unfortunately, I can't help you beyond that.
Its possible to start the VB.NET application automatically in admin mode.
That can be changed in the project-settings.
After that you can open msg.exe with the following command:
Shell("msg.exe")
On windows and such I used to use a trick to find out of a file is currently in use (written specifically).
I use to open the file for writing and if it failed most likey another process is busy accessing it.
Sadly these trick (using C OPEN with exclusive lock for writing) doesn't work on my Mac. While my curl in a terminal is still writing my -fileBusy() check fails.
fcnt call on the fd with F_GETLK doesn't reveal any locking as well.
Is there any chance for me to detect if a file is in use by another process?
Ps> listening for fsevents can't be done because my app launches after the is created by the other app / process.
Apple confirmed via email that the solution described in the link below is a valid one and not considered a private API.
More information:
http://lists.apple.com/archives/cocoa-dev/2010/May/msg01455.html
You could try running the following shell command using NSTask:
lsof -Fc path/to/thefile
That will give you the process ID and name of any process(es) that have thefile open.
i am using trk for phone debug
it is working properly for Helloworld project
but it is showing error for my project when i start project in phone debug mode
1)Load failed
2)TrkProtocolPlugin:failed to download specified file to target
(please verify that target path is writable)
if any body understand what problem i am facing plz help me out from this problem
Thanks in advance
In your case, I would check:
if the application has correct privileges assigned (along with appropriate certificate)
if ID of the application is not in conflict with some other application on device
if installation package does not contain problematic commands (e.g. copy commands to non-accessible directories)
Can you manually install the application on the phone? That is the first test you must perform before even attempting to use TRK.
Also, can your application start, at least to the point of showing a panic? TRK cannot help you if the applications cannot even load its DLL dependencies due to for example Platform Security capability mismatch. TRK needs a process to attach too in order to do its job ...