Sign in to follow this  
Followers 0
bob IT

Pb with a simple run command with W2000

12 posts in this topic

I 'd try to insert keys in the registry. Therefore i've make a autoit file compile in exe (scr.exe). I launch it by a other autoit file(lan.exe) which give this error :

unable to execute the run program

le chemin d'accès spécifié est introuvable (path file not found)

Both exe(lan and scr) are in the same directory H:\

lan.exe:

$USERNAME = "xxx"

$PASSWORD = "xxx"

If Not IsAdmin() Then

RunAsSet($USERNAME, @ComputerName, $PASSWORD)

Run("h:\scr.exe")

If @error = 1 Then

MsgBox(48, "Erreur", ".........")

EndIf

EndIf

RunAsSet()

I've tried Run("\\serv\toto\scr.exe") Run("scr.exe", @scriptdir, @SW_HIDE) Run("scr.exe"). The same message appears. The scr.exe alone works well.

Thanks for your help :ph34r:

Share this post


Link to post
Share on other sites



Are you on a domain [network login]?


Who else would I be?

Share this post


Link to post
Share on other sites

Try:

an.exe:

$USERNAME = "xxx"
$PASSWORD = "xxx"

If Not IsAdmin() Then

RunAsSet($USERNAME, @ComputerName, $PASSWORD)
DriveMapAdd("H:", "\\serv\toto\")
Run("h:\scr.exe")
If @error = 1 Then
MsgBox(48, "Erreur", ".........")
EndIf

EndIf
RunAsSet()

If you use runas you do not have any mappings to the server., you create a new session...

Hinfie

Share this post


Link to post
Share on other sites

a begin of response

The problem seems not to be dued to AUTOIT. The same pb appears with other .exe and even with a "regedit /s toto.reg " (enable to found toto.reg)

My mapped directory(H:\) where the two .exe are is on NETWare 5 server. When i put them on a windows 2000 server, my script works.

I think there is a pb whith login script Novell when a .exe launchs a onother .exe located on the same server.

Anyone has a idea??

I'm going to look for a explantion with the Novell's support

Thanks :ph34r:

Share this post


Link to post
Share on other sites

a begin of response

The problem seems not to be dued to AUTOIT. The same pb appears with other .exe and even with a "regedit /s toto.reg "  (enable to found toto.reg)

My mapped directory(H:\) where the two .exe are  is on NETWare 5 server. When i put them on a windows 2000 server, my script works.

I think there is a pb whith login script Novell when a .exe launchs a onother .exe located on the same server.

Anyone has a idea??

I'm going to look for a explantion with the Novell's support

Thanks    :ph34r:

<{POST_SNAPBACK}>

BobIt,

You have to realize that you are changing the programs credentials after the Runas command. Does internal Adminitrator account have access to Novell ?

Often is better to copy the file to the local disk before doing the Runas() command and then run the program from the localdisk.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

a response to JdeB

The Novell'client connects to the Novell server and makes a map to the directory where the two autoit .exe are. The Novell's client have all the rights on this directory. In the same time, the client opens a local session on the computer with privileges of simple user. Using the "runasset" permits in fact to have administrator's rights to modify to the registry.

In order to answer to your question, there is no link between the local administrator of the W2000 PC and the user's rights on the novell's server. And it may be the pb ??? The test with "regedit /s toto.reg" has been done with Windows 98 which is less strict and it fails too.

I would test the copy in local. And I think that it will work. Unfortunately, when we have big files to execute, the copy though the network can take a long time.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

a response to JdeB

The Novell'client connects to the Novell server and makes a map to the directory where the two autoit .exe are. The Novell's client have all the rights on this directory. In the same time, the client opens a local session on the computer with privileges of simple user.  Using the "runasset" permits in fact to have administrator's rights to  modify to the registry.

In order to answer to your question, there is no link between the local administrator of the W2000 PC and the user's rights on the novell's server. And it may be the pb ??? The test with "regedit /s toto.reg" has been done with Windows 98 which is less strict and it fails too.

I would test the copy in local. And I think that it will work. Unfortunately, when we have big files to execute, the copy though the network can take a long time.

<{POST_SNAPBACK}>

Well i guess the point i am trying to make is that when your script is running on Pc and you do a RunAsSet command, from that moment on every program that is shelled by Run() or RunWait() will run under the new credentials and will not have access anymore to any networkshare that was MAPped for the User that logged on to Novell.

I don't understand the "Big file" remark you make. When you Run a program from a Fileservershare, it will also have to be downloaded by the pc first before execution, so theres no real difference when you first copy the file to localdisk, then do a RunAsSet() and then the RUN() command.

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

the script with the copy of one of the .exe files on the local disk works.

It's right that the script(first .exe) is launched by the novell's user(it' works) and the second .exe in a run command by the local admin. And the local admin have no right on this directory but the error message is surprising "specified path file not found" because local admin knows the directory (because it is mapped before with the login script novell)

OR the error message has no meaning??

For the big file(> 3Mb), you are right because when the file is launched, it is charged any way in memory. No big difference with copy to the disk and launch.

:ph34r:

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

but the error message is surprising "specified path file not found"  because local admin knows the directory (because it is mapped before with the login script novell)

OR the error message has no meaning??

<{POST_SNAPBACK}>

I am pretty sure that the drive mapped before the RunAsSet will not be available anymore after the RunAsSet and thus is the Error valid when you try to shell a program from a mapped drive ... Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I am pretty sure that the drive mapped before the RunAsSet will not be available anymore after the RunAsSet and thus is the Error valid when you try to shell a program from a mapped drive ...

<{POST_SNAPBACK}>

Yes, it's right that I mapp the drive and the .exe are launched and then I unmapped the drive.

Must I remain the drive mapped to avoid the error and make the script worked ?

The operations are sequentials in a login script novell. Normally the .exe are launched before the drive becomes unmapped ....or there a pb of delay on my network...

Edited by bob IT

Share this post


Link to post
Share on other sites

Yes, it's right that I mapp the drive and the .exe are launched and then I unmapped the drive.

Must I remain the drive mapped to avoid the error  and make the script worked ?

The operations are sequentials in a login script novell. Normally the .exe are launched before the drive becomes unmapped ....or there a pb of delay on my network...

<{POST_SNAPBACK}>

Believe that you are saying something different than i am trying to explain here.

The RunAsSet command will make ALL drives, that are mapped and existing at that particular moment, unavailable because you are changing the credential. So you need to copy the file to the c: drive before running the RunAsSet command in the script.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Think of it this way. The PC is logged on as user A. The drive is mapped as user A. When you use RunAsSet(), your script thinks its now logged on as user B. So now, when you try to use Run/RunWait, you are user B. user B must have that drive mapped for them, too. Once you use RunAsSet(), user A no longer matters, you're user B now.

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