MSFN Forum: How can you remove "desktop.ini" from the desktop? - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How can you remove "desktop.ini" from the desktop? Rate Topic: -----

#1 User is offline   LeveL 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 551
  • Joined: 30-September 05

Posted 03 February 2007 - 12:22 AM

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 after
about 30 seconds) and I can see the desktop.ini file there, this command is not
deleting the file. If I let it reboot and run the above command, it does delete the
file... 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 its
not because its a hidden system file... maybe I could put a 5 second wait between
the 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 5

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"


But I have a feeling this has nothing to do with it since on XP I have removed
attributes 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 file
there and the command does not delete it.


#2 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,482
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 03 February 2007 - 05:05 PM

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

#3 User is offline   LeveL 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 551
  • Joined: 30-September 05

Posted 03 February 2007 - 10:51 PM

View PostmaxXPsoft, on Feb 3 2007, 11:05 PM, said:

Are you running as an Admin?


Yes.

View PostmaxXPsoft, on Feb 3 2007, 11:05 PM, said:

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 can
do a reg import before that like with XP @ T-12 minute stage...

View PostmaxXPsoft, on Feb 3 2007, 11:05 PM, said:

Or is that acctually Firstlogoncommands which run as the Admin


Yes, its under <FirstLogonCommands> which is why it has to sleep a while
before 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?

#4 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,482
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 04 February 2007 - 07:33 AM

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

#5 User is offline   LeveL 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 551
  • Joined: 30-September 05

Posted 09 February 2007 - 03:53 AM

View PostmaxXPsoft, on Feb 4 2007, 01:33 PM, said:

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


Yeah thats the only reason they are visible for me, I am setting tweaks to
show all files.. all meaning.. ALL.

Its weird... it takes about 30 seconds to log in and I have set it to sleep
for 90 seconds, the CMD that runs the delete command kicks in after about
75 seconds so thats 45 seconds after it has finished logging in... maybe I
could just not set it to show all hidden system files but I didn't really want
to do that... I like being able to see pagefile.sys and anything else thats
there... although saying that, there are a lot of strange shortcuts on the C
drive that you cannot even access, those wouldn't show if the tweak was
removed and I guess it looks a lot more tidy too.

Its always the principle of it with me though, none of this solves the problem
of why that desktop.ini can't be deleted on the first login! I can manually
run the commands in the first post on the first login no problem and it deletes
the file.

I suppose Vista is protecting itself somehow, which I can't complain about. :rolleyes:

This post has been edited by LeveL: 09 February 2007 - 03:54 AM


#6 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,482
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 09 February 2007 - 07:23 AM

SLEEP 5
surely you copy sleep.exe to system32 with Oems?
Otherwise it may need a full path if located with cmd

but you did say it was delaying
things still to figure out with this vista for sure

This post has been edited by maxXPsoft: 09 February 2007 - 07:25 AM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy