# 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 post ##### Share on other sites There appears to be a missing slash in $RunPath = "\netshare\to-my"

It couldn't be that simple could it?

GrahamS

##### Share on other sites

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

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

##### Share on other sites

If everyone has read access on this directory,

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

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)

##### Share on other sites

I was just thinking the program woulnd't work without proper access rights, say they were installing something.

Did you say the compiled works on your machine?

AutoIt3, the MACGYVER Pocket Knife for computers.

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

##### Share on other sites

LoL, I do that all the time. Glad you got it working. I was a bit stumped on this one.

AutoIt3, the MACGYVER Pocket Knife for computers.

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...