Sign in to follow this  
Followers 0
MadBoy

Running programs from network env

13 posts in this topic

Hello,

I have application that is on network share f.e "\\server\somedir\some.exe". I want it to run from that path. I want no user interaction (user doesn't have to know login or password). Computer may or may not be in domain. Now i have problem here as i don't know what to use for that matter:

1. I can use DriveMapAdd but i don't realy want that. Would prefer other way

2. I can use RunAsSet but it will only work for computers that are in Domain (as i would use domain login and password to run the file from server). For computers that aren't in domain it won't work. Example (unless i made some mistake here):

Opt("RunErrorsFatal", 0)
    RunAsSet($domain_login, $domain_name, $domain_password, 2)
    If FileExists($Lotus_Notes_Full_Binary_Path) Then
        RunWait($Lotus_Notes_Full_Binary_Path)
        If @error = 1 Then 
            MsgBox(16, "Error 03", "Can't start program"). 
            Exit
        EndIf
    Else
        MsgBox(16, "Error 04", "Can't access file"). 
        Exit        
    EndIf
    RunAsSet()

Is there other solution? Or i have to use DriveMapAdd?


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites



One solution would be to set up a hidden share (which is just a regular share with a $ after the name) on the computer. Set it up with read/write permissions to Everybody so that it doesn't need a username/password to access. Then, you can access the program using the UNC path. For example:

1) You have a server with a network name of Bull.

2) The server has a D: drive with a physical directory called "Apps"

3) You place your program, named Butt.exe in the D:\Apps directory of the server.

4) You set up a hidden share called "Frogs$" that maps to D:\Apps

5) In your program you call the exe on the server, passing a few optional parameters:

RunWait("\\Bull\Frogs$\Butt.exe -Water -Tight")

This has the advantage of working on a stand alone server or a server that is part of a domain as authentication isn't required for either.


Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

One solution would be to set up a hidden share (which is just a regular share with a $ after the name) on the computer. Set it up with read/write permissions to Everybody so that it doesn't need a username/password to access. Then, you can access the program using the UNC path. For example:

1) You have a server with a network name of Bull.

2) The server has a D: drive with a physical directory called "Apps"

3) You place your program, named Butt.exe in the D:\Apps directory of the server.

4) You set up a hidden share called "Frogs$" that maps to D:\Apps

5) In your program you call the exe on the server, passing a few optional parameters:

RunWait("BullFrogs$Butt.exe -Water -Tight")

This has the advantage of working on a stand alone server or a server that is part of a domain as authentication isn't required for either.

Actually I use Hidden Share already. I also share it for everybody with "read access". But it doesn't work as you say it should. Unless i also have to set Security to All too?

Edit: adding security "all" doesn't change anything. Don't think it will work this way :|

Edited by MadBoy

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

Actually I use Hidden Share already. I also share it for everybody with "read access". But it doesn't work as you say it should. Unless i also have to set Security to All too?

Edit: adding security "all" doesn't change anything. Don't think it will work this way :|

You either have faulty code or you don't have the share set up with the correct permissions. I just ran a test on my company LAN and it works fine. Run your app in SciTE like this and see what the output is:

ConsoleWrite(RunWait("\\Bull\Frogs$\Butt.exe -Water -Tight") & @CR)

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

You either have faulty code or you don't have the share set up with the correct permissions. I just ran a test on my company LAN and it works fine. Run your app in SciTE like this and see what the output is:

ConsoleWrite(RunWait("\BullFrogs$Butt.exe -Water -Tight") & @CR)
ConsoleWrite(RunWait("\\mysecondarycomputer\Lotus$\FlashFXP\flashfxp.exe -Water -Tight") & @CR)

No go.. answer is "Unknown login or password". I'm testing this at home thou. Laptop isn't in domain connects to computer that is in domain (but has not contact with domain). I gave full permisions to Lotus$ for everyone and Nothing :|

>Running:(3.2.1.11):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Project.AU3\test15.au3"

C:\Project.AU3\test15.au3 (1) : ==> Unable to execute the external program.:

ConsoleWrite(RunWait("\\mysecondarycomputer\Lotus$\FlashFXP\flashfxp.exe -Water -Tight") & @CR)

Błąd logowania: nieznana nazwa użytkownika lub nieprawidłowe hasło.


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

Are you sure your Administrator passwords or other login u use in your company lan doesn't work for both computers? :whistle: Here i am logged in as Administrator which has diffrent pass on my laptop and diffrent on other computer.


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

Are you sure your Administrator passwords or other login u use in your company lan doesn't work for both computers?

You've answered your own question. If the share is open to Everybody (including the Guest account), why would you need a password at all? :whistle:

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

You've answered your own question. If the share is open to Everybody (including the Guest account), why would you need a password at all? ;)

If it would be that easy it would work. And it doesn't work here :whistle:

Edit: The thing is even if i share it to Everyone and i type in command line (not in autoit) \\myserver\Lotus$ it still asks for login and password. I think if Windows finds same account on both computers it tries to match passwords.

Edited by MadBoy

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

If it would be that easy it would work. And it doesn't work here ;)

Edit: The thing is even if i share it to Everyone and i type in command line (not in autoit) \\myserver\Lotus$ it still asks for login and password. I think if Windows finds same account on both computers it tries to match passwords.

Just a long shot but in a comand window (cmd.exe) you are able to do a:

cd \\myserver\Lotus$
dir

Or do you get the same error?

I did this once and thought that anyone should have access through the guest account. Only thing was, the guest account was disabled :whistle:

Share this post


Link to post
Share on other sites

Just a long shot but in a comand window (cmd.exe) you are able to do a:

cd \\myserver\Lotus$
dir

Or do you get the same error?

I did this once and thought that anyone should have access through the guest account. Only thing was, the guest account was disabled :whistle:

That won't work ;) CMD says that "CMD program doesn't support UNC paths" :P And for the guest accout. It's disabled on 90% of computers so it ain't good. I guess i'll go with Mapping drive.

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

That won't work :whistle: CMD says that "CMD program doesn't support UNC paths" ;) And for the guest accout. It's disabled on 90% of computers so it ain't good. I guess i'll go with Mapping drive.

Okej I found solution for my problem. Just before share is used either in FileExists or in RunWait... i do drivemapadd for the same server so the access rights are correct, and then everything works by using UNC paths. It's a little work around but it works :P


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

Sorry for multiple posting but i found best solution for this:

DriveMapAdd("", "\\myserver\Lotus$", 0, $login, $pass)

Tnx to that drive isn't mapped but as helpfile states connection is made so authorization is done.

It works perfect :whistle:


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

That won't work :whistle: CMD says that "CMD program doesn't support UNC paths" ;) And for the guest accout. It's disabled on 90% of computers so it ain't good. I guess i'll go with Mapping drive.

hmm, Yeah cd does not work (sorry about the unfortunate example) I usually use dir or copy or something like that :P

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