My requirement is to run a file with extension '.bat'. However, the Blue Prism Application Modeler only accepts programs with the extension '.exe'.
My first thought was if I could spy Windows Explorer like an application, and navigate and spy File Explorer interface elements in order to navigate to and run that file by clicking it.
Don't spy Windows Explorer windows! This is directly contradictory to best practices. (If you need to traverse file/folder structures in the filesystem, use the Utility - File Management VBO bundled with Blue Prism.)
Run the batch file instead using the Start Process action within the bundled Utility - Environment VBO. In later versions of Blue Prism, the VBO also includes the similar Start Process and Read Stderr and Stdout which not only starts the process but also captures the terminal outputs:
Related
I am trying to show and configure Quick Launch toolbar on Win 10 taskbar from command line / batch file / registry patch / PowerShell script / VBS / C# / C++. After searching the Internet, I was able to accomplish two steps out of three:
Pre-fill the "%USERPROFILE%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch" folder with the .lnk files that I want to appear in the Quick Launch toolbar - this is easy.
Force the Quick Launch to show on the taskbar by adding a specific blob into HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop key, TaskbarWinXP value and restarting Explorer so that the changes take effect. The format of the blob is not documented, but this is of no concern to me - I simply need to ensure that the taskbar contains only Quick Launch toolbar and no other toolbars, so I can afford to just prepare the taskbar on a test machine, export the blob and then import it into the registry on target machine. And the Quick Launch toolbar does show up on the taskbar and shows all the links corresponding to .lnk files. Not the most elegant way, but it works.
Update 0: actually it does not really work - the account name is hard-coded in the blob as part of the path to the Quick Launch folder, so when moving from a test machine to the target machine the blob will not work if the username is different of the target machine. I guess I will need to reverse-engineer the blob format anyway in order to generate a correct one.
But, and this is where I am stuck, the Quick Launch toolbar needs further configuration programmatically, specifically:
Hide the toolbar title
Hide individual text for the link icons
Move the toolbar all the way to the left so that it is next to the Start button
I can't find any recipes for that.
These settings are not stored in the HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop key, TaskbarWinXP value blob, I did binary comparisons of different versions of this blob before and after manual change, they are identical. They must be stored somewhere else.
Update 1: I was wrong, these values are stored in the blob, but they are not committed to the registry right away by Windows Explorer. It seems like Explorer holds these values in RAM and only commits them to registry when it terminates normally, e.g. during logout or reboot. If you terminate Explorer by killtask, it won't commit these changes.
I also tried spying on the system using SysInternals procmon64 while I perform these three actions manually with a mouse. Process monitor does not detect any meaningful and relevant activities with either registry or files during such manual manipulations, only a bunch of background noise. But Explorer has to store these changing settings somewhere... What am I missing?
Update 2: As I have mentioned in the update 1, the reason I don't see any registry traffic when I am manually creating the toolbar is because Explorer postpones registry commit until normal shutdown.
So, after all updates, I have quite opposite situation: I no longer have issues with item 3, but I do need to know the format of the blob stored in registry HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop key, TaskbarWinXP value. Or a proper API to create such blob. Anyone has any pointers?
OK, I have solved my problems. And I did not have to reverse-engineer the blob format for that (although I have started that fun process and managed to learn a few things about its internal structure). Anyway, my solution was this:
On a clean test machine manually create a Quick Launch toolbar using the mouse, but, when asked to specify the path to the toolbar folder, instead of navigating step-by-step to C:\Users\<insert_your_fixed_username_here>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch, which would commit a fixed username into the blob as part of the path, you need to specify "%USERPROFILE%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch" in Select Folder dialog as one line (the starting location for the Select Folder dialog is not important in this case). When you do that, Explorer will create a blob where the current user name is not hard-coded, and instead the environment variable %USERPROFILE% name is placed in the blob. This makes the blob re-usable for any user I want to deploy the Quick Launch toolbar to.
Adjust the Quick Launch the way you desire (title, text, position, width, icon order).
Log out from your account on test machine and log right back in. This is critically important - if you do not log out or if you kill Explorer, it will not commit your new toolbar settings to the registry.
Export HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop key from the registry into the .reg file for future use.
The rest is easy, write a batch file that does the following:
For each given user on the target machine prepares the "C:\Users\<insert_your_fixed_username_here>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch" folder and places necessary .lnk files there and deletes unnecessary ones.
Imports .reg file into the target machine registry (reg import command).
Kills and restarts Explorer: taskkill /f /IM explorer.exe & start explorer.exe
Now any desired user on your target machine will have exactly one Quick Launch toolbar and no other nonsense toolbars! And the toolbar will have the look and feel you want.
Tested on both real and virtual machines, works equally well.
Caveat: did not test on non-English version of Win10, and I expect localization issues because some folder names are hard-coded now.
For a future project, I need to track user activity to record their productivity time. I want to detect which file is currently open in apps like Adobe Photoshop for example and detect when the user switches to other app or another file/tab.
To make my desktop app, I wish to use electron JS
Can you just give me some tracks to follow ?I don't find any nodejs library that allow me to do that, but I know that is possible because it already done with electron apps like:
Chronos https://electronjs.org/apps/chronos-timetracker
Paymo https://electronjs.org/apps/paymo-time-tracker
ScreenAware https://electronjs.org/apps/screenaware
And an other App which not seems to be built with electron :
https://desktime.com/features
Thanks for your help
node.js doesn't have the capabilities you require, however it can call external programs to get the job done. The way I see it, you would need to have a PowerShell script (or C# program) to get the active window from the operating system, and find all open file handles for the process behind that window. You would invoke this script from node, and build your gui around it.
A good starting point is this module active-window which works exacty as I described: a nodejs process calls some external scripts (in bash/PowerShell) that use OS specific primitives to get the active window.
To get the list of files opened by a process, you could use the handle utility from Sysinternals. However you may run into a small problem: apps like Photoshop usually don't keep the file handle open, they just open it when saving the file. This means that you won't always be able to detect open files. I guess trial and error is your friend here.
To find open tabs, it's more complicated. Tabs usually indicate the internal state of an app, and this information is held in memory. Some apps might offer an API, but that's not guaranteed. I guess screenshots are the way to go here.
I've been developing in Idea on Linux for a little while now and am getting used to it after the initial pain of transitioning from Eclipse.
One of my problems has been how to configure the file manager. I'm running Openbox on Arch Linux and I can't see an obvious way (despite some extensive Googling) to specify a default file manager and I'm not sure if Idea would use it if I did.
Does anyone know how to specify the file manager in Idea for Openbox on Linux?
Click IDE Settings -> External Tools, and then click the Add button.
Specify the tool - like in this screenshot:
http://kobo.github.io/grails-improx/img/idea-external-tools-edit-sh.png
Basically you can specify any external program you want.
The program path should point to the binary file you want to use as a file manager (for example thunar is a great one: /usr/bin/thunar (you can find the correct path by executing "$which thunar" in a terminal)).
The parameter & working dir should be "$FilePath$" & "$FileDir$ (or you can choose other variables if you prefer different functionality)
For part of a large university project I have built a large java based application. To make "installation" cleaner I am aiming to write a script to copy the jar to a hidden file in the users home directory then add a menu &/Or desktop launcher.
Since I do not know what platform the markers shall be using it seems sensible to make this generic so I was going to build a shell script and a batch file.
The shell script starts off simple, check the directory doesnt already exist, make it and copy the file accross.
Then it comes to making a launcher of some kind. I presume each desktop environment shall do things differently.
After 10 minutes with google it seems everything suggested is autotools but since I have no knowledge of this it seems a bit overkill.
Is there an easy way to achieve what i need?
Thanks
These days, basically all of the desktop environments uses desktop files. For the specification for those files, see the Desktop Entry Specification.
Normally, they're put in /usr/share/applications on the system. Those files are then read and used to construct the menu.
If you have the ability to write to the system /usr/share/applications directory, that's obviously simplest, but if you had that, you would probably be putting the JAR file somewhere other than a hidden directory in the user's home directory.
If not, the path that's supposed to be honored is ~/.local/share/applications. If you drop a desktop file in there, it should show up for the user. (This is somewhat newer; I don't think GNOME 2 supports, it for example. Older desktop environments had various special places for these files.)
Then, the problem basically reduces to figuring out what to write for the Exec line in the desktop file. (See the desktop files on your system in /usr/share/applications for some examples.) If you're lucky, you can get away with just sticking a java command in there, but the details will depend on your application.
I wrote a Qt application that is going to run on Linux. It supposed to run at startup.
It's supposed to run on every Linux- Suse, RedHat etc.
What script should I write and Where to put it?
I don't know how to write scripts at all, so I would appreciate it if you will attach an example.
You need to create a desktop entry file for your application (see here) and to put it in user's $HOME/.config/autostart directory.
Any desktop entry file in that dir will get executed when a Window Manager starts up (see here).
To do this, usually you'll need to create your desktop entry file by hand (that's it, not via C++ code/script) and to just install in that directory via C++ code.