Jump to content

Using UNC paths


Jamaica
 Share

Recommended Posts

I want to install software and run the install from a server using the application install switches but I get no install to commence. Here is the script i'm using

Run("\\Server\dir\setup.exe /S /v/qn")

Whats wrong with this picture??

Are you sure the script has access to that share at run time? You might also need to provide a working directory. Maybe:
$sDir = "\\Server\dir"
$sExe = "setup.exe"
$sPath = $sDir & "\" & $sExe
If FileExists($sPath) Then 
    ShellExecute($sPath, "/S /v /qn", $sDir)
Else
    MsgBox(16, "Error", "File not found:  " & $sPath)
    Exit
EndIf

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Yes, the script has access to the server with full rights to the dir where the setup.exe is located. I'll try what you suggested an give a shout back. ShellExecute is the trick I see. Thanks.

Are you sure the script has access to that share at run time? You might also need to provide a working directory. Maybe:

$sDir = "\\Server\dir"
$sExe = "setup.exe"
$sPath = $sDir & "\" & $sExe
If FileExists($sPath) Then 
    ShellExecute($sPath, "/S /v /qn", $sDir)
Else
    MsgBox(16, "Error", "File not found:  " & $sPath)
    Exit
EndIf

:)

Link to comment
Share on other sites

Yes, the script has access to the server with full rights to the dir where the setup.exe is located. I'll try what you suggested an give a shout back. ShellExecute is the trick I see. Thanks.

I never had problems running from UNC path. As long you were authenticated to see that UNC paths :)

And I used rather:

RunWait(@ScriptDir & "\1\AICinstall\AgentInstaller\AgentInstaller.exe")

Meaning script is running from \\server\somefolder\script.exe ..

Edited by skysel
Link to comment
Share on other sites

I want to install software and run the install from a server using the application install switches but I get no install to commence. Here is the script i'm using

Run("\\Server\dir\setup.exe /S /v/qn")

Whats wrong with this picture??

I'm missing the share!

What about: Run("\\Server\sharename$\dir\setup.exe /S /v/qn")

Link to comment
Share on other sites

You might also try --

$dir = "\\Server\dir"

Run($dir "\setup.exe /S /v/qn", $dir)

You need the concatenate "&" operator for that: Run($dir & "\setup.exe /S /v/qn", $dir)

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You need the concatenate "&" operator for that: Run($dir & "\setup.exe /S /v/qn", $dir)

:)

Oops! That's what I get for typing the code directly in the forum, and not in SciTe!!

Roger O."When people show you who they are, believe them.” --Mark Twain

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