Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Creating a task to copy file to different folder on different Windows OS

Created: 07 Dec 2012 • Updated: 11 Dec 2012 | 13 comments
This issue has been solved. See solution.

 

 

Hello =)

 

As im fairly new to Altiris, I come by theese forums alot and have learned much. Especially when I hit the wall, you guys have been peach!
But alas, today Im struggelig with something most of you might consider easy - So here goes.

 

At my current work location we are in the middle of upgrading all our computers to Windows7 from WindowsXP. And we would like to "force" our users to get up the local internett page which holds alot of information for our company. So what we have decided is to simply put a .url file in Windows all users Startup folder.

 

I have made the task that copies the file to Windows7's Startup folder, and a task that does the same to WindowsXP since they don't share a common path.

My problem, is to "bake" this into one software delivery, that detects that if its WindowsXP, the task to copy to XP's Startup folder is run, and vice versa.

So far I have done this.

Tasks
#1 Copy Innsiden.url Windows 7
Basic copy file task which copies that .url to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

#2 Copy Innsiden.url Windows XP
Basic copy file task which copies that .url to C:\Documents and Settings\All Users\Start Menu\Programs\Startup

I've tried to figure out how to bake thoose two into ONE package, which have a detection rule that detects eiter windows 7 or XP, and runs the apropriate task.

 

 

Thank you for reading, and looking forward to see what you Wizards come up with =)

Steffen Borge

 

 

Comments 13 CommentsJump to latest comment

Indrek_K's picture

Hello,

I would do two software policy's for the copy jobs.

And target the correct machines using the default filter's all windos 7 machines or all windows xp.

Hope this will help you

SteffenBorge's picture

Yeah, ive been into the same thought.

 

Altho, for some reason the Task i have made, works perfect when dooing a quickrun task, but not when running as a software policy. It fails.

Currently only applied to myself, since im testing it on my win7.  But your tip about pushing it out to "all Windows 7 computers" filter was one of thoose obvious things i really should have thought of myself hehe.

 

 

 

Indrek_K's picture

For softwre policy the client needs to have Softwar Managemen solution agent (plugin)

SteffenBorge's picture

All our 1000 ^ish clients have that. We use altiris to push out software via msi packages and such, and have noe problem dooing so. We also use Altiris to deploy win7 x86 and x64 images.

So its not any missing plugins, I asure you =)

 

And, like I said - If i run the task as a Quickrun task, my test computer runs it, and the .url file is correctly copied to the windows 7 all users startup folder.

When i put the task in a software policy, and run it like that - It fails. :(

 

Sachin_Joshi5's picture

Hello,

I have not tried this but I was checking if we can use use existing system variables to eliminate some hardcoded foldernames from path as below:

Windows 7:  C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

%ALLUSERSPROFILE% == C:\ProgramData

Windows XP ; C:\Documents and Settings\All Users\Start Menu\Programs\Startup

%ALLUSERSPROFILE% == C:\Documents and Settings\All Users

It could have been worked If ALLUSERSPROFILE veriable would have same value for both win7 & XP.

Here is a work around, though not polished but should give ultimate result:

1. Prepare a job & add copy file tasks for Win7 & XP to it.

2. Uncheck 'Fail Job if any Task fails'on the job

3. Run the job on clients

As a result this job will run on every client. Win7 task will fail for XP & vice versa. but your goal will be achieved when script will run on OS it is meant to be. 

Another way is the go to filters & select all machines under Win7 filter & schedule Win7 copyfile task and similar  for XP clients.

SteffenBorge's picture

Hm .. Can a "job" run like a policy inside the Administration agent ?

If i have to run this job manually every noe and then, its not what i need.
Afterall, we get new computers into our environment every week, and i want them to get all the programs and suchs through there. Including this file into the startup folder.

Or am I misunderstanding ?

Anyway, I understand what you mean, so ill give it a try as a job, with the two tasks in it, and remove "fail job" part. =)

 

SteffenBorge's picture

Ok, i tried your way Sachin.

If i created a JOB and ran it it worked.
It failed on the xp part since i run win7, and it failed on the win7 on my xp test machine.

But - I can't really "use" it, as i cant make a deliverable software policy with job. (Or can I ?)

 

I need this to be inside the Administration agent so together with other deliverable software that Altiris automaticly installs on my client PC's.
To have to run it manually every now and then is not an option.

Sachin_Joshi5's picture

Ok. Agreed. Your requirement is different than I initially perceived.

SteffenBorge's picture

Yeah .. Its starting to get a little frustrating.

One would think that to copy a single .lnk file to allusers startup folder would be a piece of cake .. But no :/

 

Anyone else got any fancy ideas ? =)

BugTastic's picture

I have yet to get a file copy job working as a policy. I'm on Verision 7 but I would have thought they would have got that sorted out by now.pfft.

I got round it by creating a package with a batch file. Basically a lot of hassle for something that should work in CMS. Crap like this makes me want to jump ship to sccm, but unfortunately I dont make those choices.

 

Joe.

SteffenBorge's picture

Im not good with batch programming, so i kinda ended up making a job, which i now have scheduled to run once everyday at 09:00. Will do that for a while, then change schedule to once a week to fish computers who for instance havent been Turned On during the first part.

Its better than nothing i guess =)

SteffenBorge's picture

Raito .. So heres what i did to finnaly "solve" the problem.

 

I did what Sachin suggested. Made a job with both the tasks in, and have now scheduled it to run on all windows computers filter, once a day at 0900 for a week.

After a week i will lower the runtime to once a week instead.
It wont show up in the Symantec Administration agent for users, to be run immediatly if its not found tho ..

Its not a GOOD solution, but for now it will have to do =)

 

 

 

SOLUTION
Sachin_Joshi5's picture

Its nice to know that the issue is solved  :)

I think when the functionality you need is not there, the tweaks (Scheduling job on filter to act like policy) done are fine as long as you get the expected end result.

Thanks,
Sachin