Jump to content

Running Program From Network Share...


Recommended Posts

I'm getting error when I run this script after login....I get no error if I run it on a local machine directly from the UNCOMPILED version...

Here is the complete script edited for security...

;---------------------------------------------

;First we must declare the following variables

;---------------------------------------------

Dim $UserName, $DomainName, $Password, $RunProgram, $RunPath

;---------------------------------------------

;Next we will assign values to those variables

;---------------------------------------------

$UserName = "user"

$DomainName = "domain"

$Password = "pwd"

$RunProgram = "\\netshare\to-my\file.exe /f /noui /noreboot"

$RunPath = "\netshare\to-my"

;----------------------------------------------------------------

;Now we will perform the install based on OS

;----------------------------------------------------------------

IF @OSType = "WIN32_NT" THEN

RunAsSet($UserName, $DomainName, $Password)

$val = RunWait($RunProgram, $RunPath)

RunAsSet()

ELSEIF @OSType = "WIN32_Windows" THEN

$val = RunWait($RunProgram, $RunPath)

ENDIF

ExIT

I am getting no errors when I run the script from my local machine, however once it is compiled and called from our login script I get an error that says it can't find the path or file. What's the deal here?

Link to comment
Share on other sites

My guess would be that your permisions are different, such as does everyone have the same drives?

Does everyone have access to:

\\netshare\to-my\file.exe /f /noui /noreboot

and

\netshare\to-my

You may have a c:\netshare\to-my directory on everyone's computer, or you might have just edited out the other \ I don't know.

anyway, does the compiled version work on your computer?

Does the compiled version work if you log on to another computer?

just a thought.

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

If everyone has read access on this directory,

why bother to select between the Windows-Versions and fiddle with RunAsSet? :whistle:

A simple

$val = RunWait($RunProgram, $RunPath)

should do the job, then... and it would exclude some error sources... I hope.

Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL)

Link to comment
Share on other sites

because in order to run the program on win nt/2000 and xp you must be an admin because it writes to the registry.

Anyway.... I figured out why it wasn't running....In the ACTUAL version I misspelled the file name.

Thanks for the help.

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