Jump to content
Sign in to follow this  
dspent

Running Program From Network Share...

Recommended Posts

dspent

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?

Share this post


Link to post
Share on other sites
GrahamS

There appears to be a missing slash in

$RunPath = "\netshare\to-my"

It couldn't be that simple could it?


GrahamS

Share this post


Link to post
Share on other sites
scriptkitty

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.

Share this post


Link to post
Share on other sites
dspent

everyone has access to the network share being referenced. In fact the \Everyone group has read access to the share.

Share this post


Link to post
Share on other sites
Marc

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.


It's my job to comfort the disturbed and to disturb the comfortable.
My Projects: Profiler, MakeSFX, UserInfo

Share this post


Link to post
Share on other sites
scriptkitty

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 this post


Link to post
Share on other sites
dspent

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 this post


Link to post
Share on other sites
scriptkitty

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.

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  

×