Dwayne
(Fresh Scripter)
2002-07-05 04:19 AM
batch file not executing under w2k

Hi,

We've recently started using kixtart - and i can get all the basic functions to work fine (such as mapping drives, etc) - however i'm having real problems trying to get an executable to run when a user logons using a group policy (we're on W2k)

Scenario:
We're trying to do an updated installation of the notes 5.0.10 client. The unattended installation works fine when run manually - but when i get it to try and launch using kixstart its seems to run but nothing happens.

I've tried using both the run and shell command, creating a batch file, or running the setup directly. Now i can get the kix script to run fine if i do it manually after logging on (by mapping to the netlogon share and running kix manually) but again if i try to use a policy nothing happens - though i can see the script running - and i use the -d switch i can parse through the script but then nothing happens.

Our script at the moment looks like this
(this is just a basic version until i can get it working)

cls
copy "\\%server%\software\Notesr5-10\Clients\notessetup.bat" "c:\lotus\"

run "c:\lotus\notessetup.bat"

and the bat file has this line

\\%server%\software\Notesr5-10\Clients\Setup.exe -s -f1 setup.iss

again it works fine if i run the kix script manually - just not while logging on...

any suggestions would be great...

[ 05 July 2002, 04:26: Message edited by: Dwayne ]


NTDOCAdministrator
(KiX Master)
2002-07-05 07:29 AM
Re: batch file not executing under w2k

Hello Dwayne and welcome to the board.

The batch file is the problem... I think

Try putting a PAUSE in the batch to see if it is even running.

However, you don't even need to copy or use the batch file. If you want to run that command you can run it from KiXtart.

Try something like this...
code:
$RunNotes='"\\%server%\software\Notesr5-10\Clients\Setup.exe -s -f1 setup.iss"'
RUN $RunNotes



Sealeopard
(KiX Master)
2002-07-05 03:24 PM
Re: batch file not executing under w2k

As usual, the question is, does the account have the correct permissions to do the install? Normally, you'll need administrative privileges to install applications under Windows 2000

LonkeroAdministrator
(KiX Master Guru)
2002-07-05 04:09 PM
Re: batch file not executing under w2k

$RunNotes='"\\%server%\software\Notesr5-10\Clients\Setup.exe -s -f1 setup.iss"'
run $RunNotes

is same as:
run "\\%server%\software\Notesr5-10\Clients\Setup.exe -s -f1 setup.iss"

about it being user rights...
if the user can install after logon, it's not about that.


NTDOCAdministrator
(KiX Master)
2002-07-05 06:27 PM
Re: batch file not executing under w2k

Yes Lonk it is the same, but now you don't have a variable to test against or log... or easily modify in a larger script.

You can use either way Dwanye, but using the variable gives you more options to use in a larger script.

Perhaps it is also an HKCU structure not being loaded during logon or some other policy.


Les
(KiX Master)
2002-07-05 06:33 PM
Re: batch file not executing under w2k

What's this %server% stuff and is it set at the time of logon? What if you hard code it or use a KiX macro?

Dwayne
(Fresh Scripter)
2002-07-07 09:34 PM
Re: batch file not executing under w2k

Thanks for the replies guys - just to answer some of the questions

1) the permissions are ok - the user account i'm using is a local power user (it has install rights - had fun with that one!) - plus once you've logged on the script runs fine if run manually (running kix32 manually)

2) the %server% is just the server name - (i'm actually using the server name in there not the %server% variable

I'll switch back to using the run command again and see what happens - it seems to be that in the logon process it stops the command from executing - as when you run the command manually there is a distinct pause before it runs - so i was wondering if during the logon process it gets cutoff somehow - i might try and use a sleep statement to get it past some of the logon stage...

i'll post the results! :-)


LonkeroAdministrator
(KiX Master Guru)
2002-07-07 09:40 PM
Re: batch file not executing under w2k

one thought which some of the big boys might verify...

there may be problem using run directly with exe in logon-process.

the logon-process is the parent and when it stops also the exe-process gets stopped.

not sure of this but line:

run "start /wait \\%server%\software\Notesr5-10\Clients\Setup.exe -s -f1 setup.iss"

cheers,


kholm
(Korg Regular)
2002-07-07 09:46 PM
Re: batch file not executing under w2k

Have you tried to specify the log, using:
run '\\%server%\software\Notesr5-10\Clients\Setup.exe -s -f1setup.iss -f2%Temp%\Notes.log'

The pause could come from the setup trying to write the log to the network drive.

-Erik


Dwayne
(Fresh Scripter)
2002-07-08 10:24 PM
Re: batch file not executing under w2k

Thanks for those suggestions guys - still no go unfortunately - i even tried mapping a drive and running it from that...

again it all works when i wait till the use has logged on and then run kix manually - its like the command itself isn't running (even trying to get it to log won't work)

now i'm starting to think whether its something we have running at startup (like antivirus software) that is stopping the executable from running


Radimus
(KiX Supporter)
2002-07-08 11:18 PM
Re: batch file not executing under w2k

the problem may also be the setup.iss.

Not the iss file itself but that it cannot resolve the path to it.

Give it the full path and see...


Sealeopard
(KiX Master)
2002-07-08 11:24 PM
Re: batch file not executing under w2k

If there is no path, it'll use the SETUP.ISS in the \WINNT directory.

Radimus
(KiX Supporter)
2002-07-08 11:30 PM
Re: batch file not executing under w2k

ohhh and use Shell instead of Run

Dwayne
(Fresh Scripter)
2002-07-08 11:47 PM
Re: batch file not executing under w2k

gave it a whirl - still no guy - though again if i run the script manually after logging on (i map a drive to the netlogon share and then just use the kix32 installnotes.kix command) it works perfectly...

Dwayne
(Fresh Scripter)
2002-07-10 05:30 AM
Re: batch file not executing under w2k

Hi Guys,

Thought i'd post an update - FINALLY found what the problem was - there was another policy that applied that stated that the logon scripts should be run synchronously - i changed it to 'not configured' changed the other policy to disable that setting (though i already had this - so i don't know why it wasn't overriding the setting - ah well another day) - logged on and away it went - so i think the original policy was stopping the 2nd policy from being applied properly...

gotta love w2k! ;-)


Les
(KiX Master)
2002-07-10 03:04 PM
Re: batch file not executing under w2k

Dwayne,
Turning off RunLogonScriptSync is probably not the best solution. There is no guarantee that the desktop will be up when you reach a particular line in the script. If you have code that needs to run later in the logon process (well actually after), better to stuff the scriptlet into the RunOnce reg key.


LonkeroAdministrator
(KiX Master Guru)
2002-07-10 03:06 PM
Re: batch file not executing under w2k

les, I don't know.
I've allways used without sync and it works a thread.


Chris S.
(MM club member)
2002-07-10 04:35 PM
Re: batch file not executing under w2k

Why not put a shortcut in the Startup folder? Or...better yet, put a entry in the Run or Runonce key in the registry. A power-user should have sufficient rights to do that. In any event, the child script shouldn't run until after the 'desktop' gets started.

{Edit} Of course, if I had read Les' post better, I might have seen that he already suggested that. Doh!

[ 10 July 2002, 16:36: Message edited by: Chris S. ]


Dwayne
(Fresh Scripter)
2002-07-10 09:28 PM
Re: batch file not executing under w2k

Hey Guys,

Thought i'd better make myself a bit clearer! It doesn't really matter whether the run logonscripts synchronously is enabled or not in the policy i am using to push it out - what *was* the problem was the other policy i had applied to that OU (the first one) which had enabled the logonscripts bit - for some reason the first policy stopped the script in the second policy from working correctly - i reset the first policy (since it didn't need to be on - this is just a Test OU i use to test these sorts of things!) and now it doesn't matter how the second policy is set - the script works fine either way - now i just need to figure out a way to get the user to wait for the install to finish :-)


LonkeroAdministrator
(KiX Master Guru)
2002-07-10 09:36 PM
Re: batch file not executing under w2k

heh, that can be solved in many cases but setfocus is the best.
user tries to do something but setfocus reverts his/her action...

get's them really annoyed! [Big Grin]


Chris S.
(MM club member)
2002-07-10 10:13 PM
Re: batch file not executing under w2k

You could always install the AutoItX dll and block input...

code:
$oAutoIt = CreateObject("AutoItX.Control")
if $oAutoIt=0
? "AutoItX not registered."
endif
$oAutoIt.BlockInput("on")
; Do your install here...
$oAutoIt.BlockInput("off")



LonkeroAdministrator
(KiX Master Guru)
2002-07-10 10:22 PM
Re: batch file not executing under w2k

also running a hidden kix window with that exe/bat is not so far a way.

only problem what comes to interrupting, user can logoff.

but then, that's their problem, is it?

[ 10 July 2002, 22:23: Message edited by: Lonkero ]


Les
(KiX Master)
2002-07-10 10:43 PM
Re: batch file not executing under w2k

Dwayne,
I have found that with ISS "Silent" installs, SHELL will not wait for the install to finish. Even using Start /W hasn't worked.

See this thread.

Topic: waiting for an installation to conclude before executing the rest of the script


Sealeopard
(KiX Master)
2002-07-10 11:13 PM
Re: batch file not executing under w2k

I am using ISS silent installs and for me 'START /MIN /WAIT' does work.