Archive: System::Call to run file


System::Call to run file
Ok, Im having a hard time here... I know there is a way to use System::Call to run a file, but I cant seem to find where I saw it at.

If only psexec would support UNC paths... :rolleyes:

Anyone have suggestions?

Thanks!


Why use System::Call instead of Exec, ExecWait, ExecShell or nsExec? What's psexec?


kichik,

I need to use System::Call to execute a batch file that points to a network share to execute other files.

PSExec is a small application that lets you run commands on a remote system. Personally, I use that to push out the applications I create with NSIS (using the -icf switch). The one big drawback to it is that it does not support network references when using the application.

What I was hoping to do is to put in the System::Call at the end of my NSIS script to execute a file on a network resource. Hopefully by using System::Call, it will trick windows into executing the batch file as the current user that is logged in and not as the LocalService account that PSExec uses.

Heres the link for PSExec for any that are interested:
http://www.sysinternals.com/ntw2k/freeware/psexec.shtml

- DF


System::Call does NOT execute files, it calls FUNCTIONS from dll files. it'll never work, unless you use a windows api function with system::call that runs batches, like ShellExecute.
but this is unnecessary, as you already have a script command available for this.

for executing files use Exec, ExecWait, ExecShell and nsExec.

@hesung: post to a new topic plz :)


Comm@nder21,

would you happen to know the syntax for ShellExecute?

I have tried using Exec, ExecWait, ExecShell and nsExec. The problem is that the application I am using to run the installs remotely, psexec, does not support networking.

The only thing that I could think of would to be to trick windows into thinking that the user ran the necessary batch file, and not the install executable.

- DF