Jump to content

Variables For CleanUp.cmd


Zubair

Recommended Posts


%SystemFolder% doesnt exist, it is %systemroot%

%AllUserProfile% Ok

What About

1, Program Files is %PROGRAMFILES%

2, Current User is %USERPROLFILE%

3, System Drive is %systemdrive%

4, etc

If you go to a cmd window type set|more to see all system variables.

Link to comment
Share on other sites

%SystemFolder% doesn't exist, it's %SystemRoot%

%AllUserProfile% doesn't exist, it's %AllUsersProfile%

What About

1, Program Files is %ProgramFiles%

2, Current User is %UserProfile% (to get just the name, not the folder, use %UserName%)

3, System Drive is %SystemDrive%

4, etc

:) but, like the rest said, you can find all the variables when you type set in the cmd window.

Link to comment
Share on other sites

Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks Thanks

1000 Time's

Link to comment
Share on other sites

Thanks for that, helps me.

But, set, doesn't show the path for the user "Default User", who is this? as some things in here are used by all users, like Accessibilty and remote assistance.lnk and i can't quite work out how to delete this folder and shortcut.

Any assistance, appreciated.

Link to comment
Share on other sites

just for note =>

%userprofile% relates to the Default User account

NO IT DOESN'T!

%USERPROFILE% = the location of the currently logged in users profile. I.e. C:\Documents and Settings\Administrator or C:\WINNT\Profiles\joe.

The only time that %USERPROFILE% points to the Default User profile is during setup (cmdlines.txt) or before anyone has logged in.

If you're writing a script and need a variable to point to the Default User profile - you have to make it yourself like this:

SET DEFAULTUSERPROFILE=%USERPROFILE%\..\Default User

Link to comment
Share on other sites

%AllUserProfile% doesn't exist, it's %AllUsersProfile%

Good eye! :)

Add to your collection: %homedrive% is definitely C: drive regardless it's being your system drive or not.

Just type it in Run box and see.

Link to comment
Share on other sites

@mazin:

%HOMEDRIVE% is the drive where your profile resides.

D:\Documents and Settings\mazin

HOMEDRIVE is D:

HOMEPATH is \Documents and Settings\mazin

@Nois3

The %USERPROFILE% is the default profile in setup, which is probably the best time to set the variable. It may also not also have the name Default User, but can instead be Default User.COMPNAME. Either pulling from the registry, or setting it during setup is the best solution here.

Link to comment
Share on other sites

OK, so if %USERPROFILE% isn't Default User, what is?

There is no environment variable for default users profile.

Add this line to your .bat file, then %DefaultUser% will point to "Default User"

set DefaultUser = "%Allusersprofile%\..\Default User"

Link to comment
Share on other sites

set DefaultUser = "%Allusersprofile%\..\Default User"

You will not find default user profile in all users profile dir?

Instead you may have to use the long way instead. ;)

Set DefaultUser = "%Systemdrive%\Documents and Settings\Default User"

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...