/build/static/layout/Breadcrumb_cap_w.png

Trying to create the folder in INSTALLDIR location with the name of USER logged in

Scenario: Application creates a runtime folder with logged in username i.e. (C:\INSTALLDIR\[USERNAME])

if the USER name is admin the folder should get creted by name Admin
if the USER name is test the folder should get creted by name test

We have tried creating the folder specific to each USER. Please see our finding what all we have tried:

1) Created a script which will search for the logged in USER and then create the folder in the required location with the User name. The script is running only in Admin not in USER.
2) Added the script in Active Setup. The Active Setup runs for both Admin and USER, and identifies the logged in USER but does not create folder structure with the username (%USERNAME%) in USERs.
3) Added the script in RunOnce key. This key does not run for USER.
4) Added the script in shortcut. In this case whenever the shortcut will be launched it will search for the Logged in USER then search for folder, if the folder is not present in required location it will create the same and then the shortcut will be launched. Working in Admin not in USER.
5) Created a script which calls the main vbscript (logic used for the main vbscript : searches for the logged in USER and creates the folder with the same name in the C:\INSTALLDIR\[USERNAME] as per the above scenario) by using elevated Admin privileges (i.e. UAC prompt), but per user this will give the password prompt to USER.

All of the above steps has been followed by giving full permissions to INSTALLDIR for USER.

Any suggestions are appreciated.


1 Comment   [ + ] Show comment
  • Sounds like you are missing something pretty big... most of those methods should work, with some being better then others.

    Is your app installer msi?

    1. I would use activesetup method for running your solution for every user that logs in. The reason why I like using active setup, is it applies to each user at login whether or not they have an existing profile or not. Some of those other methods will not run for existing or new profiles. This is just a personal preference.

    2. You tried lots of scripts but never stated if the scripts them selves worked. Break your testing down so you know where its not working. Is it the script, is it rights, is it how you are automatically running it (activesetup, runonce... etc). Sounds like you might not have permission-ed the folder right if all those scripts failed to even create a folder unless you were admin. - dandirk 11 years ago

Answers (3)

Posted by: SMal.tmcc 11 years ago
Red Belt
1

give all users rights to install dir

are you using in the users runonce regkey

if not exist "c:\installdir\%username%" md c:\installdir\%username%

 

Posted by: jagadeish 11 years ago
Red Belt
1

// Application creates a runtime folder with logged in username i.e. (C:\INSTALLDIR\[USERNAME])//

 

Your application should be having some reference in "HKCU" Registry/'HKLM" (Tokonized) registry/"INI File"/ any "File" to create such folders in INSTALLDIR.

Find out that reference and redirect this runtime folder creation to %LOCALAPPDATA% or My Documents folder.

Posted by: Visalakshi 11 years ago
Orange Senior Belt
0

Giving permissions to non admin users to the folder where the %USERNAME% directory needs to be created will solve the problem.You can use the script in msi in NOTRMEOVE condition if you have advertised shortcut and user files or use activesetup keys.


Comments:
  • >give all users rights to install dir
    >Giving permissions to non admin users <snip> will solve the problem

    Errrrr...did you guys read the OP's post? As in:
    >All of the above steps has been followed by giving full permissions to INSTALLDIR for USER.

    @OP, I'd say that the most likely scenario is that you *haven't* actually permissioned the target folder. Which group did you add to the ACL? Was it 'Users' or 'Domain Users'? I'll bet it was the former.

    As ever, ProcMon will show you everything you need to know, in terms of file activity, access being requested and so on. - anonymous_9363 11 years ago
  • i have already given permissions for users - sakshi26 11 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ