Page 1 of 1 1
Topic Options
#193770 - 2009-05-11 07:45 PM using run() instead of shell() in startup scripts (with robocopy)
Tomarse Offline
Fresh Scripter

Registered: 2005-04-26
Posts: 9
I'm having some issues here and i am not sure what is causing them.

I have been using shell() in my startup scripts to run robocopy and copy some files locally.
This works perfectly:
 Code:
shell '\\domain\netlogon\robocopy src dest /b /njh /nfl /ndl /E /sec /R:0 /purge /log:c:\log.txt'


However, If i have a lot of files to copy this can cause a wait while robocopy runs. I would therefore like to use the run() command instead and make robocopy not slow my script down.

 Code:
run '\\domain\netlogon\robocopy src dest /b /njh /nfl /ndl /E /sec /R:0 /purge /log:c:\log.txt'


The problem is that this only seems to work intermittantly.
It always runs without any KIX errors but robocopy doesnt seem to be doing anything sometimes.
Soemtimes the robocopy log is normal, but usually it is just an empty file - and robocopy has not run (the files are not there).

If i manualy run the script with run()'s with a logged on user it then always works.

Am I missing something or does windows do something like terminating all my startup script processes automatically once the end of the main script has been reached?
Is there any way round this? Can anybody suggest an alternative to run()

Top
#193771 - 2009-05-11 08:49 PM Re: using run() instead of shell() in startup scripts (with robocopy) [Re: Tomarse]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Well you could kick off another script with a run command and in that other script you could shell out (just do it all silently so that the user doesn't know that its running)

Then let the first script exit out on it own normally.

Top
#193830 - 2009-05-13 07:49 PM Re: using run() instead of shell() in startup scripts (with robocopy) [Re: NTDOC]
Tomarse Offline
Fresh Scripter

Registered: 2005-04-26
Posts: 9
 Originally Posted By: NTDOC
Well you could kick off another script with a run command and in that other script you could shell out (just do it all silently so that the user doesn't know that its running)

Then let the first script exit out on it own normally.


I'll give that a try, thanks.
I had tried run()ing a batch file and that stops too. doing something like

 Code:
run('calc.exe')


Also results in the calculator running and then exiting as soon as the logon prompt appears.

There isnt a windows security thing where it stops any processes when you press CTRL-ALT-DEL to logon is there?

Top
#193831 - 2009-05-13 09:15 PM Re: using run() instead of shell() in startup scripts (with robocopy) [Re: Tomarse]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4572
Loc: USA
I've never used a startup script, only logon scripts... so this setting may or may not having any relevance.

Windows XP Professional Fast Logon Optimization
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=112428#Post112428
_________________________
(... better days ahead)

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.113 seconds in which 0.086 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org