Jump to content

help Hiding cmd window when using "Run"


Recommended Posts

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

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

thanks for the fast reply

well,. 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 by FireFox
Link to comment
Share on other sites

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

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 everything

and 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 by fharen
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...