Jump to content

User Profile Issues


Go to solution Solved by ioa747,

Recommended Posts

Posted (edited)

Good day,
I hope that the day finds you well!

I am having an issue with User Profiles on the same system...say UserA and UserB.

I created a script under UserB...which functions as it should when logged in as UserB.

However, if I attempt to run the very same script as UserA, the script no longer functions!

Any ideas! This IS just a bit frustrating!

Thank you for your time...appreciated!

PS: Here is the script...which is launched from Drive D...

; -----------------------------------------------
#RequireAdmin
; -----------------------------------------------
Opt("MustDeclareVars", 1)
; -----------------------------------------------
ExitFolder()
LaunchFolder()
LaunchTxt()
; -----------------------------------------------
Func ExitFolder()
    Local $sSrcPath = "D:\"
    Local $iFileExists = FileExists($sSrcPath)
    ; -----------------------------------------------
    If $iFileExists Then
        WinClose($sSrcPath)
    EndIf
EndFunc   ;==>ExitFolder
; -----------------------------------------------
Func LaunchFolder()
    Local $sSrcPath = "D:\Initial_Prep"
    ; -----------------------------------------------
    ShellExecute($sSrcPath)
    WinWait($sSrcPath, "")
    WinMove($sSrcPath, "", 406, 100, 550, 650)
EndFunc   ;==>LaunchFolder
; -----------------------------------------------
Func LaunchTxt()
    Local $sSrcPath = "D:\Initial_Prep\Procedure_Initial_Prep.txt"
    ; -----------------------------------------------
    ShellExecute($sSrcPath)
    WinWaitActive($sSrcPath, "")
    WinMove($sSrcPath, "", 964, 100, 550, 650)
EndFunc   ;==>LaunchTxt
; -----------------------------------------------

 

Edited by mr-es335
Typos, Updated Posting Title
  • mr-es335 changed the title to User Profile Issues
Posted

I guess, either user A has admin rights, and user B doesn't have admin rights?

#requireadmin

 

or user b doen't have the required NTFS permissions do access what you address in your script.

keep in mind, that "no-access" is the highest "Privilege", if you get it by means of any group membership, you will lose access even as an administrator.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Posted (edited)

ioa747,

Yeppers!...Ya' got it!

What I do NOT understand, is that I always enable that feature...and thus, I have NO IDEA how that option got changed on UserA?!?
• I mean, I actually wrote a script that enables that feature at the very beginning of my Windows installations.

Here is that script [UpdateRegistry]:

; -----------------------------------------------
#RequireAdmin
; -----------------------------------------------
Opt("MustDeclareVars", 1)
; -----------------------------------------------
UpdateRegKey()
; -----------------------------------------------
Func UpdateRegKey()
    Local $sSrcPath = RunWait('REGEDIT /S "D:\Assets\RegKeys\UpdateExplorer.reg"')
    ; -----------------
    Local $sMessage = "Update Registry Key..." & @CRLF & @CRLF
    Local $iWidth = 450, $iHeight = 245, $iOpt = 5, $sFontName = "FuturaBQ-DemiBold", $iFontSize = 14
    ; -----------------------------------------------
    SplashTextOn("", $sMessage, $iWidth, $iHeight, -1, -1, $iOpt, $sFontName, $iFontSize)
    ; -----------------------------------------------
    For $i = 1 To $sSrcPath[0]
        Local $sResult = $sSrcPath[$i]
        ; -----------------------------------------------
        Switch $sResult
            Case 0
                $sResult = "The Registry WAS updated successfully!"
            Case 1
                $sResult = "The Registry WAS NOT updated successfully!"
        EndSwitch
        ; -----------------------------------------------
        $sMessage &= $sResult & @CRLF
    Next
    ; -----------------------------------------------
    $sMessage &= @CRLF & "Update Registry Keys is now completed..." & @CRLF
    ; -----------------------------------------------
    SplashTextOn("NOTICE!!", $sMessage, $iWidth, $iHeight, -1, -1, $iOpt, $sFontName, $iFontSize)
    Sleep(2000)
    SplashOff()
EndFunc   ;==>UpdateRegKey
; -----------------------------------------------

Here is the RegKey [UpdateExplorer.reg]:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]

; Display the full path in the title bar: [CabinetState]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState]
; Display the full path in the title bar...; 1=Enabled, 0=Disabled, Status: Enabled
"FullPath"=dword:00000001

Thanks again, 101747! You are very much "underdemciated!"....I mean "appreciated!"

 

Edited by mr-es335
Posted (edited)
Local $sSrcPath = RunWait('REGEDIT /S "D:\Assets\RegKeys\UpdateExplorer.reg"')
   ...
   ...
   ; -----------------------------------------------
    For $i = 1 To $sSrcPath[0]
        Local $sResult = $sSrcPath[$i]
        ; -----------------------------------------------
        Switch $sResult
            Case 0
                $sResult = "The Registry WAS updated successfully!"
            Case 1
                $sResult = "The Registry WAS NOT updated successfully!"
        EndSwitch
        ; -----------------------------------------------
        $sMessage &= $sResult & @CRLF
    Next
    ; -----------------------------------------------

$sSrcPath is not an array; it is a single exit code. This loop will not work as intended.

 

 

Edited by ioa747

I know that I know nothing

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