Jump to content

RunAsSet over Novell network


 Share

Recommended Posts

  • 1 month later...

You may try this one, this works for me:

;This must be an account which has access to a network share
$password = "*"

RunWait(@ComSpec & " /c " & 'net user Administrator ' & $password & ' /ADD /DOMAIN', "", @SW_HIDE)
RunWait(@ComSpec & " /c " & 'net localgroup Administrators Administrator /ADD', "", @SW_HIDE)

RunAsSet("Administrator", "domain name here", $password,0)

;Run the shared exe installer file
RunWait("\\computername\sharename\installer.exe")

; Reset user's permissions
RunAsSet()

RunWait(@ComSpec & " /c " & 'net localgroup Administrators Administrator /DELETE', "", @SW_HIDE)
RunWait(@ComSpec & " /c " & 'net user Administrator /DELETE /DOMAIN', "", @SW_HIDE)

Hope this helps..

Link to comment
Share on other sites

I'm sure I'm missing something completely here, but why is all this even necessary? I use MacroExpress to run scripts that manipulate/run/save/delete files on a Novell Netware drive all the time. Wouldn't the same problem apply to any program running a script in an environment such as this have similar problems? Why would any script compiled with AutoIT be any different? The same goes for VBS, it doesn't seem to have problems using Netware mapped drives.

If these other programs/langs are able to get around this problem automatically, why can't we work something out for AutoIT that would do the same?

It seems odd to me, but then again, I'm new to this game, so...

“Efficiency is doing things right; effectiveness is doing the right things.”-Peter F. Drucker

Link to comment
Share on other sites

  • 2 months later...

Sure you can. :D

Works:

; Set up passwords
$passWord = "LOCALPASSWORD"
$nwPassWord = "NWPASSWORD"

; Assess whether we're an admin. If not RunAsSet to an admin user for the Local
; machine and re-run the script with superfluous parameters under the new
; credentials. If we arrive in this loop again with the superfluous parameters
; on the command line, the user in RunAsSet wasn't an admin, so exit.
If (Not IsAdmin()) Then
   If $CMDLINE[0] = 5 Then
      MsgBox(0, "Error", "The provided user is not an Administrator on this PC. Please contact your administrator.")
      Exit
   EndIf
   RunAsSet("localadmin", @ComputerName , $passWord)
   Run(@ScriptName & " 1 2 3 4 5")
   RunAsSet()
   Exit
EndIf

DriveMapAdd("", "\\xxx_zs1\zen", 0, "zenadmin", $nwPassword)
Run("\\xxx_zs1\zen\apps\tools\bginfo.exe")

; Enjoy.

I'm running this from ZEN in a moment, I'll update this post with any alteration...

Runs as posted from a ZEN simple application running as the current user.

- ZEN 6.5, 4.01

- NetWare 6

- Windows XP SP1, SP2

I tried this and no luck.. still cannot get to the netware share. I tried making 2 seperate exe. Still no go.

here is the first exe

; Set up passwords

$passWord = "************"

; Assess whether we're an admin. If not RunAsSet to an admin user for the Local

; machine and re-run the script with superfluous parameters under the new

; credentials. If we arrive in this loop again with the superfluous parameters

; on the command line, the user in RunAsSet wasn't an admin, so exit.

RunAsSet("*******", @ComputerName , $passWord)

;MsgBox (53, "ll", @ScriptDir & "\run1.exe")

Run(@ScriptDir & "\run1.exe")

RunAsSet()

Exit

here is my second exe

DriveMapAdd("", "\\nalsrv\data3\nalinst\", 0, "myzendude", "myzenpass")

Run("c:\WINNT\system32\wscript.exe \\nalsrv\data3\NALINST\XP\sp87\install.vbs")

Where am i going wrongs... thanks

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...