Sign in to follow this  
Followers 0
lsakizada

How to execute application on map drive

3 posts in this topic

please help on this one.

Why I am getting "Access is denied" when running this script?

The output:

$flag=1
TDERR read:Access is denied.

The Script:

#include <Constants.au3>

DriveMapAdd("X:", "\\murphy\baselines\tp24_bpm_setup\nt\1225\Dvd\Windows\bpm\En", 8, "domain\username", "password")
$flag = FileChangeDir("X:")
ConsoleWrite("$flag=" & $flag & @CRLF)
Local $foo = Run(@ComSpec & " /c setup.exe /s /forcenoreboot /qn", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

Local $line
While 1
    $line = StdoutRead($foo)
    If @error Then ExitLoop
;MsgBox(0, "STDOUT read:", $line)
    If StringStripWS($line, 8) <> "" Then
        ConsoleWrite("STDOUT read:" & $line & @CRLF)
    EndIf
WEnd

While 1
    $line = StderrRead($foo)
    If @error Then ExitLoop
;MsgBox(0, "STDERR read:", $line)
    If StringStripWS($line, 8) <> "" Then
        ConsoleWrite("TDERR read:" & $line & @CRLF)
    EndIf
WEnd

Be Green Now or Never (BGNN)!

Share this post


Link to post
Share on other sites



Maybe because you have your working directory for Run() set to @SystemDir instead of "X:\".

Share this post


Link to post
Share on other sites

Thank you, thats was helpful! :P


Be Green Now or Never (BGNN)!

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