fharen Posted August 5, 2013 Share Posted August 5, 2013 hey there guys,. I'm kinda new in Autoit and I'm having a problem on hiding cmd prompt,. I'm trying to make a personal program that should protect my files a bit,. and put a password on it,. I got it working,. but I want the cmd prompt not to appear,. for example Run(@ComSpec & ' /c ren "<renaming folder>" "<new name>"') it just stops working when I make it Run(@ComSpec & ' /c ren "<renaming folder>" "<new name>"' , @SW_HIDE) it works fine if I don't try hiding the cmd window that's flashing on the screen any suggestions? Link to comment Share on other sites More sharing options...
FireFox Posted August 5, 2013 Share Posted August 5, 2013 Hi, Welcome to the autoit forum Have you tried the DirMove or the FileMove function? Br, FireFox. Link to comment Share on other sites More sharing options...
fharen Posted August 5, 2013 Author Share Posted August 5, 2013 thanks for the fast reply well,. if I think about it,. that approach moves files to another folder right? what I want is to rename the folder only,. I noticed that I was putting the @SW_HIDE in the wrong place ("workingdir") so I made it Run(@ComSpec & ' /c ren "<renaming folder>" "<new name>"', "", @SW_HIDE) still not working Link to comment Share on other sites More sharing options...
FireFox Posted August 5, 2013 Share Posted August 5, 2013 (edited) thanks for the fast replywell,. if I think about it,. that approach moves files to another folder right?No, not necessarily :DirCreate("test") FileWrite("test\toto.txt", "test") DirMove("test", "test2") ShellExecute("test2")From the helpfile:Because AutoIt lacks a "DirRename" function, use DirMove to rename a folder!Br, FireFox. Edited August 5, 2013 by FireFox Link to comment Share on other sites More sharing options...
fharen Posted August 5, 2013 Author Share Posted August 5, 2013 alright,. let's just say that your way works well,. does that mean it's impossible to hide the cmd if I do my approach? as I've said,. I already got it to work,. I just need to hide the cmd that's flashing whenever I try to run it,. Link to comment Share on other sites More sharing options...
FireFox Posted August 5, 2013 Share Posted August 5, 2013 (edited) Even I don't understand why you want to use the cmd, try this:Run(@ComSpec & ' /c ren "test" "test2"', @ScriptDir, @SW_HIDE)Note: Change the working dir (here @ScriptDir) to the folders' directory.Br, FireFox. Edited August 5, 2013 by FireFox Link to comment Share on other sites More sharing options...
fharen Posted August 5, 2013 Author Share Posted August 5, 2013 (edited) the reason is I also want to hide cmd from Run(@ComSpec & ' /c echo y| CACLS "test1" "/P" "Users:F"') so rather than using different approach,. I used the same for everythingand nope,. the program doesn't even run when I put @ScriptDir Scratch that,. it works,. but now the hiding function stopped : p,. anyways,. thanks I think I know what to do now ^_~ EDIT: yep,. it's working now. thanks!! Edited August 5, 2013 by fharen Link to comment Share on other sites More sharing options...
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