Jump to content

Recommended Posts

Posted

I am new to AutoIT although MANY years ago I used a similar program called WinBatch to automate morning routines.

I am having some issues running code from the command line.

If I use this line in my script

Run ('cmd.exe /K "C:\start microsoft-edge:https://app.flowalgo.com/users/login"')

It opens the cmd screen but the directory is set to the directory where the script that is running is located.

C:\Autostart-Workstation\AMStart, and I need it to run from the C prompt

I can get it to open at the C prompt with

Run ('cmd.exe /K "cd\"')

Is there a way to force the code to run from the root prompt ("C:\")?

or how do I send the code to the cmd screen once I've changed to the root drive

 

Posted

Look at the help file. This is parameter #2 of Run().

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

  • Developers
Posted (edited)

Maybe?:

Run ('cmd.exe /K "C:\start microsoft-edge:https://app.flowalgo.com/users/login"',"c:\")

Jos

edit: yea...what he said ;) 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)

Probably don't use the C:\ at the start, since I'm assuming the second parameter "c:\" tells it to start there?

And is /c still the switch to autoclose the cmd screen?

Edited by dinotom
  • Developers
Posted
5 minutes ago, dinotom said:

Probably don't use the C:\ at the start, since I'm assuming the second parameter "c:\" tells it to start there?

Did you open that Helpfile to check the purpose of the parameters?

6 minutes ago, dinotom said:

And is /c still the switch to autoclose the cmd screen?

Why would you think this is any different from normal and did you simply try? 

Life can be simple ;)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

Of course I eliminated the starting C:\ because I could see that wasn't necessary with the parameter and I added the /c switch and it works fine.

Thanks for leading me in the right direction.

I always answer the replies with any further questions, before I try new code, so hopefully I get an answer right after re-failing ((-;

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
×
×
  • Create New...