AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Bat file will not run using RUN Command

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
captainspacedog



Joined: 21 Jul 2009
Posts: 27

PostPosted: Thu Jan 14, 2010 9:44 pm    Post subject: Bat file will not run using RUN Command Reply with quote

I am trying to run a batch file that creates a shared folder using the "Run" command. It does not execute.

Do I have to convert this to a Comspec command and any ideas what the syntax would be?
Thank you for any assitance you can provide.

IfExist, %AppFolder%\Components\CreateShare.bat
Run, %AppFolder%\Components\CreateShare.bat
;Creates a share

Contents of CreateShare.bat file:
rem Creating Admin directory.
mkdir "C:\IO Agent"
net share IOAgent="C:\IO Agent" /UNLIMITED
echo y | CACLS "C:\IO Agent" /T /E /G Everyone:F
Back to top
View user's profile Send private message
captainspacedog



Joined: 21 Jul 2009
Posts: 27

PostPosted: Fri Jan 15, 2010 1:23 pm    Post subject: Reply with quote

Still having trouble formatting the Extrrnal batch file to a comspec command. Any suggestions?
Back to top
View user's profile Send private message
BoffinbraiN



Joined: 16 Nov 2009
Posts: 114

PostPosted: Fri Jan 15, 2010 1:47 pm    Post subject: Reply with quote

I have no experience on this, but one workaround that comes to mind is to "run cmd.exe" and then type your batch file path into there via Send, and press {enter}.
Back to top
View user's profile Send private message Visit poster's website
fred
Guest





PostPosted: Fri Jan 15, 2010 2:00 pm    Post subject: Reply with quote

Perhaps something like Run, %comspec% /c "%AppFolder%\Components\CreateShare.bat" ?
Back to top
captainspacedog



Joined: 21 Jul 2009
Posts: 27

PostPosted: Fri Jan 15, 2010 3:20 pm    Post subject: Reply with quote

Ohhhh that worked just fine. Thanks so much!!!
Back to top
View user's profile Send private message
BoffinbraiN



Joined: 16 Nov 2009
Posts: 114

PostPosted: Fri Jan 15, 2010 8:24 pm    Post subject: Reply with quote

Ahh... That's good to know. I guess I was half-way there by using cmd.exe (%comspec%).
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group