Jump to content

How to determine current user profile via script?


jorsak

Recommended Posts

Greetings all. Thanks for such great efforts and answers from knowledgeable people.

I'm writing a script to install a group of maintenance apps (Ad-aware, Spybot, etc.). The install part is perfect now and does all I need it to do. However, I'm working on the cleanup part now. After all the apps are installed they create shortcuts all over the desktop and start menu. Is there any way to determine via a script or command what user profile the script was run under and automatically have it delete the shortcuts and folders from the startup menu?

something like:

Del \documents and settings\%currentuser%\desktop\ad-aware se personal

Link to comment
Share on other sites


%userprofile% = C:\documents and settings\FRED (Fred is the current user logged on)

%AllUsersProfile% = C:\documents and settings\All Users

make sure u add quotes around it

DEL /Q /S "%userprofile%\something.lnk"

Link to comment
Share on other sites

DUDE! You rock! :-) I can't wait to get home and try this out. The script is coming along nicely. I ahev a few qerks to work through, but so far it's proving a HUGE time saver.

I have a question. I was trying to delete "Ad-aware SE Personal" icon from my desktop via a DOS prompt and was having NO luck.

I tried:

del C:\my path\ad-awa~1.lnk

del C:\my path\ad~1.link

del C:\my path\ad-aware SE Personal.lnk

del C:\my path\"ad-aware SE Personal.lnk"

del C:\my path\'ad-aware SE Personal.lnk'

and about 90 other versions and never could determine the right file name.

Is there any way to make 2K or XP display the DOS name of a file? It showed me the long file name in my directory (Which of course I could not delete using.)

Thanks again for such great help.

joe

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...