Jump to content
Sign in to follow this  

How to remotly execute files with Samba?

Recommended Posts

I posted that on the other forum (club-init) but since most of the gurus are here now.. lol


Once I'm in I get

smb: >

Now, if I type '?' I get

smb: > ?

?              altname        archive        blocksize      cancel

cd             chmod          chown          del            dir

du             exit           get            help           history

lcd            link           lowercase      ls             mask

md             mget           mkdir          more           mput

newer          open           print          printmode      prompt

put            pwd            q              queue          quit

rd             recurse        rename         rm             rmdir

setmode        symlink        tar            tarmode        translate


Which command remotly execute a .exe on a windows computer? .. I tryed 'open blablabla.exe' but it didn't work. Is it possible?





Share this post

Link to post
Share on other sites

I don't believe that you can execute a command on a remote computer with Samba. Though I think that you can run a program on your computer thats stored on a remote one if yours has the ability.I think you'll have to Telnet into it to have the ability of remote executiion.

Share this post

Link to post
Share on other sites

So what are all these commands about? What about 'open' ?


Why there is no 'exec' or something?


Is it possble to make 'self-executing' programs then if we can't exec them remotly?

Share this post

Link to post
Share on other sites

I can "open" 'files on a windows box like email and such but I can't "run" a "program" on a windows box. Thats just a plain out and out security violation that even windows(yes even them) wouldn't let happen.

Share this post

Link to post
Share on other sites

in unix you can open a x session on the other computer and log in as a local user & exe files on that computer

vnc same thing, runs on windows to.

you can telnet into windows but thats cmd line only


your problem is, you are not trying to execute programs on the win box, but trying to use the exe on your linux box.

If you had 2 win98's for example you would still not be able to execute an exe on another box, you might run the program but it would be run on the box you are sitting at.


The only way i know to have files execute on the other machine is to use a server of some type on the box in question.

Eg apache with mod_php or mod_perl


you would make a webpage on the remote server box








$command="C:windowsnotepad.exe"; // the command you want to execute

$worked = exec("$command"); // exec() execute the command it returns true/false

// therefore we can look at $worked to see if it was successful or not.

if($worked == 1) //if $worked was true


$message = "The program was executed";


else // if $worked was false


$message = "The program failed to execute";






<title>executes some predefined program in this case notepad</title>




<h1>executions r us</h1>


<p><? echo $message; // displays the message on the web page ?></p>






to run this script you would simply open a browser and type in


thats all folks.


note: by running this script the notepad would not open on your computer but the one with the apache server on it.

This should work for a win95/98 computer most likely not for nt based one as you have to set all the file/folder permissions up on nt.


Probably not what your looking for aye?

You wanna run windows programs on a windows computer and display them on your linux box right?

vnc is probably your best option for that (if it involves sound, it's a pain apparently).

Share this post

Link to post
Share on other sites

samba is only a files/printers sharing protocol. You can only access things. Execution is your machine's job, and your machine doesn't have Windows (depending on the app, Wine may be OK).

If it is remote execution that you want, I think VNC is the only solution, unless your Windows machine is a NT terminal Server or XP (in this case you can use the more efficient rdesktop).



Share this post

Link to post
Share on other sites

Thx all for all you replies.. I really appreciate it.


That's kind of sad... I would have like to start things up on one of my friends computer without installing anything like Apache or VNC .. lol


Yes I know about VNC .. I'm using it to remotly connect to my desktop. But I still have to execute some stuff on my computer .. anyway.





Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...