
MrBedo
Members-
Posts
18 -
Joined
-
Last visited
MrBedo's Achievements

Seeker (1/7)
1
Reputation
-
GPEDIT.MSC not responding to SendKeys
MrBedo replied to MrBedo's topic in AutoIt General Help and Support
#RequireAdmin So I thought I'd exhausted the forums looking for solutions to this. Turns out I missed the one with the answer I needed! In my defence, it's 5am here and I've been at this nonsense for about 16 hours straight (not the Autoit, but this lovely little project 🤯🔫). cheers -
Can anyone save my sanity with this one?! I'm trying to manipulate the local group policy editor using sendkeys, I won't bore you with the reasons why. I can launch it, I can (I'm pretty sure) get it as the active window but no matter what I do, I cannot get it to react to the keys I send. If I swap the gpedit.msc for notepad.exe (along with the relevant window titles where appropriate) it works like a charm. I'm sure it's me being a muppet somewhere along the line, but I can't see it. The If statement is there for testing purposes and I can confirm that it comes back with a "Got it" message. Thanks in advance for any help with this. run(@comspec & " /c gpedit.msc") WinWaitActive("Local") If WinActive("Local") Then MsgBox(0, "Result", "Got it.") Else MsgBox(0, "Result", "Not active.") EndIf Send("{F}") Send("{RIGHT}") Send("{DOWN}") Send("{TAB}") Send("{DOWN}") Send("{ENTER}") Sleep(500) Send("{TAB}") Send("{ENTER}") Sleep(500) Send("{TAB}") Send("{TAB}") Send("{ENTER}")
-
joeadkins reacted to a post in a topic: Can't run .exe
-
Unable to delete Autoit compiled exe
MrBedo replied to MrBedo's topic in AutoIt General Help and Support
Shutting down the VM resulted in me being able to delete the exe. That suggests that the exe was bein held open but I'd already checked that it wasn't still runnign in the background. I hadn't used any 'wait' commands in the script either. At least I know how to resolve it now, but I'm still at a loss to explain the behaviour. -
So this is a really strange one. If I compile an AU3 file (using right-click menu), I can delete it, no problem. However, if I run that exe from within a VMWare virtual machine as a different user (non admin) I can no longer delete the exe. Worse still, I can't edit the permissions on the exe or even take ownership. I should say that I'm a domain admin and have no problem taking over files and folders usually. I cannot delete the file as the non-admin (VM) user either. The script from which the exe is compiled contains a 'RunAs' command and I cannot delete the exe using the account that command calls either. The exe doesn't change location at any point during this process. Can anyone shed any light on this behaviour? thanks
-
How to RegRead an unknown registry key ?
MrBedo replied to MrBedo's topic in AutoIt General Help and Support
I've been playing with this for a while today and have a question if that's ok.......... The second version of the script you posted doesn't work for me, it errors with the following message: Any idea why it might be doing that ? If I use the first script you posted then it works fine. The only issue I have with it is that it doesn't seem to search subfolders. This isn't a major issue and I'll see if I can work it out myself, but like I said before, I'm not exactly a pro at this stuff yet !! cheers -
How to RegRead an unknown registry key ?
MrBedo replied to MrBedo's topic in AutoIt General Help and Support
Thanks for the pointer. I'm gonna dissect it and see what I can do with it (best way to learn, right?). In case you hadn't gathered, I'm not an advanced Autoit user, so I might be tripping over my own feet for a bit while I work out what all that code does !! Thanks again for the help -
How to RegRead an unknown registry key ?
MrBedo replied to MrBedo's topic in AutoIt General Help and Support
Sorry, should have told you that ! Right, the REG_SZ key that I need is unique to that one place in the registry. To find it manually I would use the 'Find' function in Regedit itself. I don't know how to do this with Autoit, or even if it would be the most efficient way of locating the REG_SZ key I need. The reg structure is like this, [HKEY_USERS\S-1-5-21-1409082233-1060284298-1163701267-1003\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Rich\84d88889a2a6bc42b3f2c69991882f2c] That last long number/letter key is an example. Theres actually about 11 similarly named folders under the 'Rich' profile. Only one of which contains the REG_SZ key that I need to read. I'd know it was the right key if I was manually browsing for it because it is absolutely unique to that one particular '84d88889a2a6bc42b3f2c69991882f2c' folder it's hiding in. So to find it manually I'd click through each '84d88889a2a6bc42b3f2c69991882f2c' folder until I saw the REG_SZ key I needed. Hope that makes it a bit clearer, I don't actually have any code example to show you, because the piece ive written only RegReads a key in the 'Profile' directory, and that is in the same place on every PC, so far then my code consists of one line. I can't go any further until I find a way of identying this one REG_SZ key. If it helps, the REG_SZ key I need will always end '.pst'. But..........there are other references to .pst in other areas of the registry, these however are irrelevant to what I'm trying to do. This is why I need to be able to tell Autoit to go to a specific folder rather than somehow get it to search the registry, cos it might not identify the correct key. Thanks for taking the time out to trawl through this !! :"> -
First of all, let me apologise if this has already been asked and answered before. I have had a search through old posts, but couldn't really find an answer. What I am trying to do is read a REG_SZ entry, but the problem is I don't know what the registry key/folder will be called. This relates to an Outlook email profile and varies from user to user. Assuming the profile is called 'Bob', I have a reg key called 'Profiles', a sub key called 'Bob', and various sub keys under 'Bob' all with names like '1cf2a3879abf8a4fb42e19189ec8191d'......if that makes sense. Now, the REG_SZ entry I want to read is in one of those oddly named keys. I'm trying to figure out a way to pull out that piece of data but can't work out how to do it. The help file talks about RegEnumKey and RegEnumVal, but they seem to rely on you knowing exactly how deep the key you want to query is. Any help would be greatly appreciated, and apologies again is this has already been asked and answered !
-
Should 'runasset' Work When Deleting Files ?
MrBedo replied to MrBedo's topic in AutoIt General Help and Support
Note to self.......RTFM !! Sorry and thanks -
I have a script which uses RunAsSet to envoke admin permissions. The first part of my script installs a program and this part works exactly like it should, but the second part which then deletes a shortcut from the "C:\Documents And Settings\administrator\Start Menu\Programs\Startup" folder doesn't work unless I log onto the PC as the admin and run the script. The script runs when a user logs onto their PC, this user does not have admin permissions which is why RunAsSet is used. I just find it odd that the delete part of the script works if I run it whilst logged on as an admin, but not when logged on as a user. The RunAsSet command is obvously working when logged on as the user because it installs the program as it should (which does require admin permissions). Does that mean the FileDelete command is not affected by the RunAsSet command ? Heres the very simple script I'm using. SplashTextOn("Program Install", "Please wait while programs are installed and configured on your system....", -1, 55, -1, -1, 1, "Times New Roman", 18) RunAsSet("administrator", "domainname", "password") Runwait('msiexec /i c:\program.msi /qn') FileDelete('C:\Documents And Settings\administrator\Start Menu\Programs\Startup\program.lnk') SplashOff() Thanks in advance if anyone can shed any light on this
-
Unknown Fucntion Name When Running Msi Install
MrBedo replied to MrBedo's topic in AutoIt General Help and Support
DOH ! Thanks for that guys, worked first time. Much appreciated -
Hi I'm using the following command: Run("msiexec /i g:\ts3\ts3.msi /qn SERVER="myserver" ADDLOCAL="ALL"") If I run this from the "Run" dialog box in Windows it works fine, but from within an autoit script I recieve an "unknown function name" error when it gets to the myserver part. The SERVER="myserver" and ADDLOCAL="ALL" are additional parameters specifict to the ts3.msi file, so I'm guessing it's something to do with this. Anyone got any ideas what I can do about this ? many thanks rich
-
Can't delete HIstory or Temporary Internet files
MrBedo replied to MrBedo's topic in AutoIt General Help and Support
Thanks MHz, that makes sense as to why it's acting strangely. Thanks to everyone for their comments, I got it working in the end by using the @COMSPEC macro and playing witht he folder switches. cheers -
Can't delete HIstory or Temporary Internet files
MrBedo replied to MrBedo's topic in AutoIt General Help and Support
Cameronsdad - no I havent, never used those commands before so I ll look into it. Bigdod - thanks, I have seen that program but I need to be able to delete these folders with my own script. Does anyone know why it isnt a straight forward job to just delete these files from those folders ? cheers -
I'm trying to create a script that will delete the content of the following folders: c:\Documents and Settings\<USERNAME>\Local Settings\History\ c:\Documents and Settings\<USERNAME>\Local Settings\Temp\ c:\Documents and Settings\<USERNAME>\Local Settings\Temporary Internet Files\ but no matter what I try (even calling a del command from within DOS) I can't get those files to delete. If I add a folder called 'TEST' under the 'Local Settings' folder and throw some random files in it then the script will delete those without issue. I've searched through the forums, but really couldn't find an answer to this, other than a script that actually opens the internet options applet and 'pushes' the delete files button etc, which isn't what I want. Can anyone tell me why I can't delete these files in this way, or suggest an alternative method ? Heres my (simple!) script: FileDelete("C:\Documents and Settings\" & @Username & "\Local Settings\Temp\*.*") FileDelete("c:\Documents and Settings\" & @Username & "\Local Settings\History\*.*") FileDelete("c:\Documents and Settings\" & @Username & "\Local Settings\Temporary Internet Files\*.*") thanks in advance for any help