LeveL Posted February 3, 2007 Share Posted February 3, 2007 I am running a CMD file on first logon. This CMD file has the "restart in 120 seconds" command first of all, then it waits 90 seconds so Vista has a chance to fully log in. After the 90 seconds is up, the next commands are like this to delete the desktop.ini file:ATTRIB -S -H -R "%USERPROFILE%\Desktop\desktop.ini"ATTRIB -S -H -R "%SYSTEMDRIVE%\Users\Public\Desktop\desktop.ini"ATTRIB -S -H -R "%SYSTEMDRIVE%\Users\Administrator\Desktop\desktop.ini"DEL /F /S /Q "%USERPROFILE%\Desktop\desktop.ini"DEL /F /S /Q "%SYSTEMDRIVE%\Users\Public\Desktop\desktop.ini"DEL /F /S /Q "%SYSTEMDRIVE%\Users\Administrator\Desktop\desktop.ini"Even though this 90 second wait is easily long enough (it probably logs in fully afterabout 30 seconds) and I can see the desktop.ini file there, this command is notdeleting the file. If I let it reboot and run the above command, it does delete thefile... does anyone know where I am going wrong or why it is not deleting the file?ATTRIB -S -H -R means take off the "hidden/system/read only" attributes, so itsnot because its a hidden system file... maybe I could put a 5 second wait betweenthe commands like this:ATTRIB -S -H -R "%USERPROFILE%\Desktop\desktop.ini"ATTRIB -S -H -R "%SYSTEMDRIVE%\Users\Public\Desktop\desktop.ini"ATTRIB -S -H -R "%SYSTEMDRIVE%\Users\Administrator\Desktop\desktop.ini"SLEEP 5DEL /F /S /Q "%USERPROFILE%\Desktop\desktop.ini"DEL /F /S /Q "%SYSTEMDRIVE%\Users\Public\Desktop\desktop.ini"DEL /F /S /Q "%SYSTEMDRIVE%\Users\Administrator\Desktop\desktop.ini"But I have a feeling this has nothing to do with it since on XP I have removedattributes and had the DEL command right after it with no problems.This isn't a case of it recreating the file on reboot - because I can see the filethere and the command does not delete it. Link to comment Share on other sites More sharing options...
maxXPsoft Posted February 3, 2007 Share Posted February 3, 2007 Are you running as an Admin? or is that a reg tweak disabling UAC is not applied till after reboot?Or is that acctually Firstlogoncommands which run as the Admin Link to comment Share on other sites More sharing options...
LeveL Posted February 4, 2007 Author Share Posted February 4, 2007 Are you running as an Admin?Yes.or is that a reg tweak disabling UAC is not applied till after reboot?Reg tweaks are applied the exact same time this command runs so,no it has not rebooted to let them take effect, I wonder how you cando a reg import before that like with XP @ T-12 minute stage...Or is that acctually Firstlogoncommands which run as the AdminYes, its under <FirstLogonCommands> which is why it has to sleep a whilebefore it logs in... otherwise I think its trying to apply reg settings too soon.Is it probably UAC thats the reason for this file not deleting? Link to comment Share on other sites More sharing options...
maxXPsoft Posted February 4, 2007 Share Posted February 4, 2007 not if you using <FirstLogonCommands> cause thats like disabling the UAC during that cmd/exe or script but once it stops you don't have the power anymore.I usually delay about a minute before my desk fully loads, of course that will vary.Reason I get those desktop.ini on desk is setting view all files, includes sys, hidden. Then theres 2 on desk and I just manually delete Link to comment Share on other sites More sharing options...
LeveL Posted February 9, 2007 Author Share Posted February 9, 2007 (edited) Reason I get those desktop.ini on desk is setting view all files, includes sys, hidden. Then theres 2 on desk and I just manually deleteYeah thats the only reason they are visible for me, I am setting tweaks toshow all files.. all meaning.. ALL.Its weird... it takes about 30 seconds to log in and I have set it to sleepfor 90 seconds, the CMD that runs the delete command kicks in after about75 seconds so thats 45 seconds after it has finished logging in... maybe Icould just not set it to show all hidden system files but I didn't really wantto do that... I like being able to see pagefile.sys and anything else thatsthere... although saying that, there are a lot of strange shortcuts on the Cdrive that you cannot even access, those wouldn't show if the tweak wasremoved and I guess it looks a lot more tidy too.Its always the principle of it with me though, none of this solves the problemof why that desktop.ini can't be deleted on the first login! I can manuallyrun the commands in the first post on the first login no problem and it deletesthe file.I suppose Vista is protecting itself somehow, which I can't complain about. Edited February 9, 2007 by LeveL Link to comment Share on other sites More sharing options...
maxXPsoft Posted February 9, 2007 Share Posted February 9, 2007 (edited) SLEEP 5surely you copy sleep.exe to system32 with Oems?Otherwise it may need a full path if located with cmdbut you did say it was delayingthings still to figure out with this vista for sure Edited February 9, 2007 by maxXPsoft Link to comment Share on other sites More sharing options...
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