Jump to content

Recommended Posts

Posted

I'm trying to run a custom exe in command prompt using a environment variable, but when i use "" it simply doesn't work.

The dos program i'm using needs double quotes to work with files.

Can anyone help me out please?

Here's the script i'm trying to get working:

Run('prog.exe copy "%appdata%\file.txt" -param',"",@SW_HIDE)
Posted

I'm trying to run a custom exe in command prompt using a environment variable, but when i use "" it simply doesn't work.

The dos program i'm using needs double quotes to work with files.

Can anyone help me out please?

Here's the script i'm trying to get working:

Run('prog.exe copy "%appdata%\file.txt" -param',"",@SW_HIDE)
Double Quotes? like this?

Run('prog.exe copy ""%appdata%\file.txt"" -param',@SYSTEMDIR,@SW_HIDE)
Posted (edited)

No, i mean like this: "%appdata%\file.txt"

Autoit needs the "" to work so that variable inside is completetly disregarded. :)

In the command prompt it would look like exactly like this what i'm trying to accomplish via autoit:

C:\> prog.exe copy "%appdata%\file.txt" -param
Edited by pintas
Posted

I'm trying to run a custom exe in command prompt using a environment variable, but when i use "" it simply doesn't work.

The dos program i'm using needs double quotes to work with files.

Can anyone help me out please?

Here's the script i'm trying to get working:

Run('prog.exe copy "%appdata%\file.txt" -param',"",@SW_HIDE)
1. Look under ShellExecute()

Run() can Only execute EXE, BAT, COM, or PIF

2. %appdata% -> $myvar&"file.txt" (@AppDataDir&"file.txt" or @AppDataCommonDir&"file.txt" as well !)

Cram...

Posted (edited)

Somehow with the '@SYSTEMDIR' it just doesn't work. The program doesn't run. If i remove the @SYSTEMDIR, the program runs, but it doesnt understand the command.

I didn't quite understand it... should i copy the proggy.exe to the systemdir?

Any other way to do it?

Thanks for your help :)

Edited by pintas
Posted

Somehow with the '@SYSTEMDIR' it just doesn't work. Nothing happens.

I didn't quite understand it... should i copy the proggy.exe to the systemdir?

Any other way to do it?

Thanks for your help :)

Oh... well no. you can change it to @SCRIPTDIR if prog.exe is in the same directory as your script. That's the working directory. I just use @SYSTEMDIR as a filler if the program I'm running is in the system path (accessible from anywhere).

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
  • Recently Browsing   0 members

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