December 27, 200421 yr So in my cleanup.cmd i have the following lines that arent working...set AUStart=%AllUsersProfile%\Start Menu\Programsset UserStart=%UserProfile%\Start Menu\ProgramsMOVE /Y "%UserStart%\Internet Explorer.lnk" "%AUStart%\Internet"MOVE /Y "%UserStart%\Outlook Express.lnk" "%AUStart%\Internet"RD /S /Q "%AUStart%\Administrative Tools"its not the variables because I have a ton of other shortcuts that are also being moved and folder that are being deleted. It seems as though its specific to these couple shortcuts and admin tools folder...Any ideas?Thanks!
December 27, 200421 yr closing CODE tags or QUOTE tags pick 1 lolset AUStart=%AllUsersProfile%\Start Menu\Programsset UserStart=%UserProfile%\Start Menu\Programsmaybe try set AUStart="%AllUsersProfile%\Start Menu\Programs"set UserStart="%UserProfile%\Start Menu\Programs"
December 27, 200421 yr Author maybe try set AUStart="%AllUsersProfile%\Start Menu\Programs"set UserStart="%UserProfile%\Start Menu\Programs"That doesnt work as you end up with the quotes in your variable and again, Ive got a ton of other shortcuts and folders that are being effected using these variables without issue.Those shortcuts are not created until you logon to desktop.Thats probably it... anyone have a good way to clean these up, short of manually doing it after logging on?
December 27, 200421 yr Why not prevent them being created, in the first place using the winnt.sif components section, then just add the shortcuts to your install source for copying over
December 28, 200421 yr @MHz Sort of off-topic, but boy-oh-boy-oh-boy, I'd give my left pinky for a good, reliable, self-deleting batch file. Do you have something in the form of a template that you could share here?
December 28, 200421 yr Author @MHz Sort of off-topic, but boy-oh-boy-oh-boy, I'd give my left pinky for a good, reliable, self-deleting batch file. Do you have something in the form of a template that you could share here?Um... how about...del filename.cmdat the end of your batch file...
December 28, 200421 yr @durexMaybe the solution is far simpler:1. If the "%AUStart%\Internet" folder is not created before moving files into it, how will the command work? 2. The "Administrative Tools" in start menu is actually a folder. It is enabled/disabled from registry.
December 28, 200421 yr filename.cmd in All Users Startup folder@echo offset AUStart=%AllUsersProfile%\Start Menu\Programsset UserStart=%UserProfile%\Start Menu\ProgramsMD "%AUStart%\Internet"MOVE /Y "%UserStart%\Internet Explorer.lnk" "%AUStart%\Internet"MOVE /Y "%UserStart%\Outlook Express.lnk" "%AUStart%\Internet"Attrib -r "%AUStart%\startup\filename.cmd"ShutDown.exe -s -t 10 -c "System shutdown required now. Thankyou for your patience."Del "%AUStart%\startup\filename.cmd"Take note of the Attrib command, the file tends to turn into read-only, when copied over during text setup.
December 28, 200421 yr Author @prathapmlIve got many other shortcuts that are being moved to the Internet folder without issue, so I know that isnt it@MHzThanks for writing that up specific to my example!Thanks for the suggestions guys... always appreciated.
January 11, 200521 yr After having these kinds of issues for the last ytear and a half. I was recently going through my scripts and it finally hit me what was going on. In my case I was ceating my user accounts before I was running my cleanup.cmd. Well after tht it is to late the new users account has already been created from the default account. By the time the cleanup.cmd is running your only cleaning up the default account and the all users account and your new user has already been made from the default account before your cleaned the default account up.So you need to reorder the way things are done. Do your cleanup and copying files and such. In my case I also do all my program installes from here so that the settings get applied to the default account also. Then as the last thing you do create your user account. For my I'm also not using the winnt.sif. All this can be done easily from cmdlines.txt. One other thing if you do this from anything but cmdlines.txt it will be to late since the accounts will already be created. This is not so bad but it will mena that you will have more accounts to clean up.
January 11, 200521 yr Author @ webWhile your setup may differ from mine, my method should effect the %userprofile% (my created account, not the default) because my cleanup.cmd is run from RunOnceEx and my accounts are created prior to RunOnceEx even running.So my cmdlines.txt creates my accounts, runs the runonceex script (which keep in mind at the time cmdlines.txt executes it, is ONLY adding the necessary RunOnce reg entries). Assuming runonceex is the last item in cmdlines.txt your pc then reboots.Upon the 1st reboot after running cmdlines.txt it automatically logs in using the account I created in cmdlines, before runonceex.cmd was executed, THEN starts the RunOnce install, at the end of which runs cleanup.cmd.So you see, at this point, when cleanup.cmd runs, youve already logged in using the account you created, so the shortcuts are created under your profile (or all users), not the default.The reason why these few shortcuts werent getting removed when my cleanup.cmd ran, is because they are actually added pretty much at the same time the desktop is drawn for the 1st time.. after the cleanup.cmd ran. So they arent effected.Hope this clears things up!
Create an account or sign in to comment