Sign in to follow this  
Followers 0
mrrlg

DOS executable

4 posts in this topic

I have a small application that takes a "snapshot" of the computer's configuration. I would like to run it from a network share against my user's computers in remote locations without having to install and uninstall it on each pc. If I enter \\server\share\sea.exe /log at the user's dos prompt it works fine and creates a log in whatever local directory the dos prompt is at. Then I have to search for the log file. It could be in the root directory or C:\documents and settings... I would like to execute the program, create the log in the network share and minimize everything as far as the user is concerned.

I have tried run('"\\server\share\sea.exe" /log') and it appears to write the log but I cannot find it on either the network share or the user's pc. Without the /log command the executable does work so I know that part of the script works. Is there a way to script where the log file is written?

Share this post


Link to post
Share on other sites



Try executing the Run function with the "working directory" parameter.

Run('"\\server\share\sea.exe" /log',"\\server\share")

There's a good chance that the above command will write the log file to the \\server\share directory. If it doesn't, see whether the program itself has a parameter that allows you to specify the output location. Many command-line programs have "/?" or "/help" switches that will give you information about what parameters they take.

Share this post


Link to post
Share on other sites

Check out psexec.exe from http://www.sysinternals.com for executing a command remotely. I use this quite often as it works great. It can copy the executable to the remote PC and run it. Or use it along with teh FileInstall() command.

If you want to run it manually from the users PC, try something like this:

$cmd = '"\\server\sea.exe" /log'
runwait(@comspec & " /c " & $cmd,"",@SW_HIDE)

B)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0