Jump to content

RunAsSet Problem


MattX
 Share

Recommended Posts

  • Developers

Please can anybody give me a tip  :idiot:

<{POST_SNAPBACK}>

Try and see if this works:

Filecopy("h:\public\b.exe", @temp & "\",1)
RunAsSet("administrator", "domainname", "password")
RunWait(@temp & "\b.exe", @temp)
Filedelete(@temp & "\b.exe")
Exit

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

@JdeB

the tip was very good, big thx :lol:

but i think this is a realy bug, and now i have a problem when i want check a network drive :idiot:

e.g. i call the script (b.exe) from the Temp-Dir

and in this file b.exe i use the command FileExists(H:\public\c.txt)

to check the file c.txt, the return value is always 0.

But i know the file c.txt exists :D

I hope that autoit can fix this problem,

or have you a second tip for me ;)

motzel

Link to comment
Share on other sites

  • Developers

@JdeB

the tip was very good, big thx  :lol:

but i think this is a realy bug, and now i have a problem when i want check a network drive  :idiot:

e.g. i call the script (b.exe) from the Temp-Dir

and in this file b.exe i use the command FileExists(H:\public\c.txt)

to check the file c.txt, the return value is always 0.

But i know the file c.txt exists  :D 

I hope that autoit can fix this problem,

or have you a second tip for me  ;)

motzel

<{POST_SNAPBACK}>

The reason i suggested the copy the file first is that ingeneral the network connections aren't there when running with different credentials.

Maybe you can test with the Options parameter?

[optional] 0 = do not load the user profile, 1 = (default) load the user profile, 2 = use for net credentials only

Also think i have seen post about some bug in SP2...

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

@JdeB

the joke is, that the same script runs with the same user on a W2K SP3/4 system perfect, it runs on XP SP1 perfect too.

Only XP SP2 is the reason for this problem :idiot:

I use AutoIT for roll-out in a network with 200 W2K PC's and 5 XP PC's and the scripts runs since the update fro XP SP1 to SP2 never correct.

What should i do ?

motzel

Link to comment
Share on other sites

@RocTx

yes of course i use a Domain-Admin-Account with full rights in the network.

When i am start my scripts under W2K or XP SP1 it works perfect,

only when i use a XP SP2 system i have this problem with the RunAsSet.

a other member has written in this thread: http://www.autoitscript.com/forum/index.php?showtopic=6544

the reason why XP SP2 works on a different way.

But i need a solution (or a work around) now :idiot:

On XP SP2 will be the correct Directory-Path (e.g. in RunWait or Run) not be found after the RunAsSet-CMD.

Look this example:

RunAsSet("administrator", "domainname", "password")

RunWait("h:\public\b.exe", "h:\public\")

b.exe will be not found :D

motzel

Link to comment
Share on other sites

Hello,

sorry, but has nobody a solution for this problem ?

I have tested other tools e.g. CPAU but all tools have the problem with XP SP2    :idiot:

motzel

<{POST_SNAPBACK}>

The administrator user you are using to run your program does not have access to the H:\PUBLIC directory. You must first copy b.exe to a local drive and run it from there. Using your example, here's one possible solution:

FileCopy("h:\public\b.exe", @TempDir & "\b.exe", 1)
RunAsSet("administrator", "domainname", "password")
RunWait(@TempDir & "\b.exe", @TempDir)
Link to comment
Share on other sites

@pacman,

sorry, this helps only to start the script (e.g. b.exe),

but when the script b.exe use a networkdrive e.g. FileExists(H:\public\c.txt) i get the same problem too.

the reason for this trouble is not my user accout (domän-admin from the w2k domän). All my scripts works fine on more than 200-W2K SP3/4 and XP SP1 workstations. Only on XP SP2 is it a problem. MS has changed api32 with SP2.

But i have a very big problem now, i need a solution yet.

motzel

Link to comment
Share on other sites

@pacman,

sorry, this helps only to start the script (e.g. b.exe),

but when the script b.exe use a networkdrive  e.g. FileExists(H:\public\c.txt) i get the same problem too.

the reason for this trouble is not my user accout (domän-admin from the w2k domän). All my scripts works fine on more than 200-W2K SP3/4 and XP SP1 workstations. Only on XP SP2 is it a problem. MS has changed api32 with SP2.

But i have a very big problem now, i need a solution yet.

motzel

<{POST_SNAPBACK}>

If H: is mapped to a Windows share then you can use the UNC path but you must RunAsSet with a domain user that has both local admin rights and access to the share in question.

Again, back to your example:

RunAsSet("administrator", "domainname", "password")
RunWait("\\server\share\public\b.exe", "\\server\share\public")
Link to comment
Share on other sites

@pacman

yes, i know but since XP SP2 does not work this script code  :idiot:

Please see this thread: http://www.autoitscript.com/forum/index.php?showtopic=6544

This is my problem, RunAsSet does not work on a windows share when you use XP SP2.

motzel

<{POST_SNAPBACK}>

Hi,

As far as I can tell, the problem in the thread you pointed to is to do with using RunAsSet with the localsystem account.

I have just tested this example on my XP SP2 pc and it worked fine.

RunAsSet("username", "domainname", "password")
RunWait('"\\myserver\myshare\LoadRunner8.cd\setup.exe"', "\\myserver\myshare\LoadRunner8.cd")
RunAsSet()

Make sure that the domain account has access to the share.

Also make sure that your filename is enclosed in quotes if it contains spaces or names that are longer than 8 chars.

Edited by pacman
Link to comment
Share on other sites

@pacman

you are great :D

big thx*

The problem was the path:

RunWait('"\\server\scripte\b.exe"', "\\server\scripte\") works on XP SP2

RunWait("b.exe", @scriptdir) works on W2K + XP SP1 but NOT on SP2 :idiot:

Thanks a lot for your help

motzel

Edited by motzel
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...