Chimaera Posted June 15, 2011 Author Posted June 15, 2011 The cmd window flashes for me on Win7 HomePremium 64-bitIt probably means it worked as you are already the owner of the files.last section is now like this though" /r /d y"Another question for the masses..Is it possible to restrict FileSelectFolder to only show main drive letters?So you can only pick C:\ or D:\ or E:\ etc and not be able to open them up? If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices()
Joon Posted June 15, 2011 Posted June 15, 2011 (edited) Another question for the masses..Is it possible to restrict FileSelectFolder to only show main drive letters?So you can only pick C:\ or D:\ or E:\ etc and not be able to open them up?If that's your only requirement, I would rather give users radio button or dropdown list. After using DriveGetDrive("FIXED") function.But, that's just me Edited June 15, 2011 by Joon
Chimaera Posted June 20, 2011 Author Posted June 20, 2011 (edited) Another small advise please Im using perms.exe to check the folder C:Users for permissions I have this which isnt working $perms = @WorkingDir & "\perms.exe" $perms_syntax = " /c " & $perms & " " & @UserName & " " & $source & "Users" ConsoleWrite($perms_syntax & @LF) $perms_check = RunWait(@ComSpec & $perms_syntax) $perms_test = StringInStr($perms_check, "P", "", "", -1) ConsoleWrite($perms_test & @LF) The consolewrite gives me /c C:\Users\Jez\Desktop\Code\Attribute and Permissions\perms.exe Jez c:\Users 0 But it should be 1 to indicate the presence of the "P" This is the CMD output for same test perms Jez C:\Users gives C:\Users\ perms: *RWXDPO- And you can clearly see the P in the cmd output So what am i doing wrong? EDIT Ok thats weird i added this If $perms_test = "P" Then MsgBox(0,"","yay") and sure enough i get yay so why is the consolewrite perms_test zero? Edited June 20, 2011 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices()
GEOSoft Posted June 20, 2011 Posted June 20, 2011 (edited) I just get an error testing it; $Source is not declared. What should that value be? I think I see your problem but I want to test it to be sure. EDIT: Actually you should be able to get a good idea yourself by running this code. $perms = @WorkingDir & "\perms.exe" $perms_syntax = " /c " & $perms & " " & @UserName & " " & $source & "Users" ConsoleWrite($perms_syntax & @LF) $perms_check = RunWait(@ComSpec & $perms_syntax) ConsoleWrite($perms_Check & @LF) $perms_test = StringInStr($perms_check, "P", "", "", -1) ConsoleWrite($perms_test & @LF) You can't read the StdIO stream with RunWait() Edited June 20, 2011 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
BrewManNH Posted June 20, 2011 Posted June 20, 2011 You might need to include the default parameters for the StringInStr function rather than an empty string and your parameters are in the wrong place. $perms_test = StringInStr($perms_check, "P", 0, -1) The zero is probably the error you're getting from the StringInStr because you started the search from the -1 position, which I'd guess is going to throw an error. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
GEOSoft Posted June 20, 2011 Posted June 20, 2011 He probably needed -2 or -3 in there because of EOL character(s) but I don't see where it should actually return a string; simply because he's using RunWait() George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
BrewManNH Posted June 20, 2011 Posted June 20, 2011 Yeah, I wasn't paying attention to HOW he was getting the string, just that he was searching the string wrong in his example. I would think the script would need to run the perms.exe program with the $STDERR_CHILD + $STDOUT_CHILD flags set to read the output from the program, rather than the exitcode. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
GEOSoft Posted June 20, 2011 Posted June 20, 2011 Don't feel bad. I had previously stated exactly the same as you did in a reply then saw the issue and had to delete that post while I was working it out again. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
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