What does "rundll32 dsquery,OpenQueryWindow" return? - java

So I'm working on a project where I would like to be able to have the user browse the Active Directory to find a machine or workstation. I already know that you can envoke this directory search in the command prompt by using:
rundll32 dsquery,OpenQueryWindow
I'm using java for my project and I understand how to capture input from a command that I execute in the program but currently, at home, I'm not connected to a domain so I cannot test what the command returns when a user selects a computer or if it even returns anything. Could someone test this for me and tell me what it returns.
Also, if anyone has any better ideas on how to achieve this without relying on window's tools, like maybe a Java API for Active Directory Services?

Instead of calling an API function using rundll32, you should use a Java based LDAP library which will encapsulate the work in front of the Active Directory (so you won't have to parse the results by yourself).
Also, if anyone has any better ideas on how to achieve this without relying on window's tools, like maybe a Java API for Active Directory Services?
Choosing a pure Java library could help you run your application on many platforms (as opposed to using Windows' rundll32 which will limit you to Windows platform)
Check out this thread: https://stackoverflow.com/questions/389746/ldap-java-library.
currently, at home, I'm not connected to a domain so I cannot test what the command returns
There are solutions for this kind of testing problems. You should read about mocking: http://en.wikipedia.org/wiki/Mock_object
Good luck!
Tal.

Talk to the AD via the LDAP API.

Related

Is it possible to build a web automation that can run through a browser?

I have created a Java program that utilizes Chrome Driver, Selenium, and Java Excel API. The program is used to automate a few different processes on Google Chrome. Currently, setting up this automation is more complicated than I would like it to be: the user needs to download a zipped folder, unzip it, download the Java Runtime Environment, and launch the program using the executable.
My goal is to simplify the installation of the automation. Ideally, a user would come to a SharePoint website, fill out a form with the parameters of the automation (potentially upload an Excel Workbook), click an "execute" button, and the automation would run. As a result, the automation would run seamlessly across platforms (Windows and MacOS) without any modifications.
I have researched changing the programming language to achieve this functionality. I concluded that a different language could remove the need for a Java Runtime Environment download, but it would still require some type of installation process. Additionally, I have researched using HTML/JavaScript, but I concluded that this is not possible because the functionality (triggering a web automation from a website) could be used maliciously without the user's knowledge. Finally, I began researching containerization through Docker. This solution seems promising but I do not know enough about it to determine if it is the appropriate solution.
What would be the best route to achieve the results that I am looking for (outlined in the second paragraph)? I have access to enterprise-grade databases that I thought may be useful. Would it be possible to have the form trigger a virtual machine to run the automation on a remote database and then output the result to the user once it has finished?
Thank you in advance for any guidance you can provide. I do not know much about making a Java program into an enterprise-grade application so any information about what to research is extremely useful. Finally, please do not hesitate to correct my logic at any point in this question as I may have drawn the wrong conclusions from my research.
You want to look into creating a jar file with your selenium code.

Executing installers programmatically

I am working on a project for my users to generate HTML pages, JS files, CSS files etc... through dragging and dropping visual elements and by going through a series of wizzards. The goal I am trying to achieve is to create an application in which users selects a runtime, for example tomcat or nodeJS and then be able to create content for that specific runtime in the manner described above. Part of this application would be the preparing of your runtime, and by that I mean installing tomcat or nodeJS for you. so the big question here would be, how do I run installers through program code ? (java 7/8 mainly)
what I have tried:
Using a strategy design pattern to determine the host platform and run a series of command in the terminal to execute an installer, problem here is that some installers start a wizzard and require further user input. and in some cases the host platform would require elevated permission. Is there perhaps a solution where one adds arguments to the terminal commands to skip an installation wizzard ?
Any help on this subject would be greatly appreciated.
Answer of Fildor was most usefull.

Using a Java program I made on a Web Server

I created a small application that, when run, creates or updates some tables in a database by extracting data from some PDF files. Everything works fine in this desktop application, but the next step for me would be to make it possible for an administrator on a website to upload a PDF file and my Java program would then run and update the tables accordingly.
The problem is I have no idea where to start with this (the site isn't done yet, but I'm running some tests and it is going to be coded in PHP). I'd like to know what kind of technologies I need to let the server run the program and update everything as it would in the offline version. Sometimes it takes a while to update everything, so ideally, the user uploading the PDF could continue browsing other pages while the server does its job. (I'll probably implement something that when the server is done processing the file, it says if the program ended successfully or not in a log file)
Can someone tell me what terms to search for on Google or give me some pointers? I haven't chosen where my website is going to be hosted either, so if someone could tell me what to look for to know if they support running applications like this, I'd really appreciate it as well!
This could also apply to other programming languages as I know a bit of Python and C++ as well, so in the future I might have some applications in those languages I'll want to use on the web.
If I'm not approaching this the right way, I'm open to other suggestions, but the best solution would be to keep my Java program intact as I know it works exactly like I want it to and I'd rather not have to start it all over again.
If your host is *NIX based you can use crontab (Automatic Task Scheduler) to run your program at set intervals. Make it check if a "new" PDF exists, and run the program if there is. There may be a way to use Windows Task Scheduler type programs to do it on Windows. This is probably the easiest way.
Alternately you can use You can use shell_exec() in your php to execute a command on your *NIX system directly to run your java program.

I want to check open applications before turn off my computer through java program

Actually I am working on a java based application which has a functionality to turn off my system on a specific time and it's working fine but, the requirement says that if any application is open then it should not be close before turn off my system must have to close all the open application manually.
I am unable to find out the solution.
I have never tried this but it looks like you would have to use: Runtime.getRuntime().exec(). This seems to be a pretty good example of how to do this.
Java JNI
https://github.com/twall/jna/
Get the list of all processes via WinAPI and check for user_name in PEB of a process.
Or this http://msdn.microsoft.com/en-us/library/aa390460(v=vs.85).aspx :)

Online App to Rip Discs to ISO/DMG

I've been thinking a lot lately about how cool it would be to have a website that allows a user to insert a disc into their drive and click a button to begin a ripping process. After the rip is complete, it would upload to a server and be hosted there. Ideally, the process would be seamless for both DVDs and CDs and work cross platform.
My question is for the developers here - what recommendations do you have on approaching this situation? Does it seem feasible? Is it something that would require a flex app, java? Can the user get away with doing this in their browser only, without having to download any software? I'd also like to make sure that if the upload disconnects during the uploading process, the user can log back in and resume the upload where it failed.
I found some software that kind of achieves what I'm looking to do, but it is downloaded and is windows only as it relies on some .dll files to complete the process. I can show you this software if it would help?
For the record, the DVDs and CDs uploaded would need to be legally owned and the uploader must have the copyright, so don't think I'm getting into any infringement or illegality issues.
Thanks for the insight!
Browsers are not the best way to upload ISOs of CD/DVD. Basically, it's like asking a user to rip the CD with UltraISO and "manually" upload the file in a Web Form.
The only way to achieve your result is definitely to create an executable application, and/or a Java/.NET applet (I don't remember if/how Mono supports .NET controls on Firefox). But the executable is the basic way. You must then use a portable framework like Java or .NET/Mono which work on Windows, Mac and Linux.
In order to avoid dependencies, you must also ship the package with all the ISO-ripping libraries needed. I don't think there is a single managed-code library to rip CDs, so you need some OS help. You program should differentiate between OSes: in Linux and Mac, use dd (lots of tutorials), in Windows use NeroAPI or an open source ripper.
Once the ISO is created on a temp folder, just open it as a stream and upload via socket. I suggest not to use HTTP but FTP instead, then!
A 1-click solution is feasible, but forget the browser

Categories