Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Spawning with the Execute command 1

Status
Not open for further replies.

NeoValence

Technical User
Mar 21, 2006
35
US
Hi All,

Would it be possible to run a script that uses the EXECUTE command to spawn another script from a network drive where your privelages for that drive are READ Only.

If so, how can it be done?

My guess is it would not be possible, since when the EXECUTE command is issued and the spawned script is ran the task file for the parent environment needs to be temporarily saved in the same dir as the parent script.

Is there a way to save the task file locally?
 
Hi All,

i think if i add this code to the beginning of the script it will work.

if not isfile "C:\script_resource\network_script.wax"
DOS "md c:\script_resource" ; create a local directory

copyfile "K:\network_script.wax" "C:\script_resource\" ; copy the script file to the newly created local dir

if isfile "C:\script_resource\network_script.wax" ; check if the copy funtion was successful
chain "C:\script_resource\network_script.wax" ; chain the newly copied script from the local dir
endif
else
chain "C:\script_resource\network_script.wax" ; chain the newly copied script from the local dir if it already exists
endif

Is there a better way than this?
 
I've not tried this before (running a script from a read-only share), but if you are correct that it writes a temp file to that location, then I think your workaround is the best solution. I would have assumed the task file would be written to the ASPECT directory on the local machine, but again I have not tested that in the past.

 
Hi All,

I have tested and found truth. Task files are written to the dir. where the script that performs the execute command resides.

My previous workaround was successful once i added an if nullstr $CHAINEDFILE condition to it. The reason for this was to avoid creating an infinite loop. The resultant procedure looks like the following:

if nullstr $CHAINEDFILE
if not isfile "C:\script_resource\network_script.wax"
DOS "md c:\script_resource" ; create a local directory

copyfile "K:\network_script.wax" "C:\script_resource\" ; copy the script file to the newly created local dir

if isfile "C:\script_resource\network_script.wax" ; check if the copy funtion was successful
chain "C:\script_resource\network_script.wax" ; chain the newly copied script from the local dir
endif
else
chain "C:\script_resource\network_script.wax" ; chain the newly copied script from the local dir if it already exists
endif
endif

I hope this helps someone out.

Thanks to all who posted,

NeoValence
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top