durex Posted December 27, 2004 Posted December 27, 2004 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!
glent Posted December 27, 2004 Posted December 27, 2004 That code wrks form me Via WPI cant see anything wrong
MCT Posted December 27, 2004 Posted December 27, 2004 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"
MHz Posted December 27, 2004 Posted December 27, 2004 Those shortcuts are not created until you logon to desktop.
durex Posted December 27, 2004 Author Posted December 27, 2004 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?
MHz Posted December 27, 2004 Posted December 27, 2004 Self-deleting batch file in all users startup folder
Yzöwl Posted December 27, 2004 Posted December 27, 2004 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
blinkdt Posted December 28, 2004 Posted December 28, 2004 @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?
durex Posted December 28, 2004 Author Posted December 28, 2004 @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...
prathapml Posted December 28, 2004 Posted December 28, 2004 @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.
MHz Posted December 28, 2004 Posted December 28, 2004 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.
durex Posted December 28, 2004 Author Posted December 28, 2004 @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.
webmedic Posted January 11, 2005 Posted January 11, 2005 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.
durex Posted January 11, 2005 Author Posted January 11, 2005 @ 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!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now