mr-es335 Posted Tuesday at 10:22 PM Posted Tuesday at 10:22 PM (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 Wednesday at 02:14 AM by mr-es335 Typos, Updated Posting Title mr-es335 Sentinel Music Studios
Solution ioa747 Posted Wednesday at 04:35 AM Solution Posted Wednesday at 04:35 AM (edited) Good day, comes to my mind: https://www.autoitscript.com/forum/topic/212198-winmove-issues Check if both users have the Display the full path in the title bar in explorer options enable Edited Wednesday at 04:45 AM by ioa747 mr-es335 1 I know that I know nothing
rudi Posted Wednesday at 11:11 AM Posted Wednesday at 11:11 AM 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!
mr-es335 Posted Wednesday at 12:53 PM Author Posted Wednesday at 12:53 PM (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 Wednesday at 01:01 PM by mr-es335 ioa747 1 mr-es335 Sentinel Music Studios
ioa747 Posted Wednesday at 10:32 PM Posted Wednesday at 10:32 PM (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 Wednesday at 10:48 PM by ioa747 I know that I know nothing
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now