Sign in to follow this  
Followers 0
broadstairs

Using Run( ) with a parm of a variable

3 posts in this topic

I am trying to use the Run( ) but instead of using a string to describe the program and its parameter I want to use a variable. It seems to work if the variable contains just the program name (notepad.exe) but if I try and use this together with the filename it fails. The variable contains "notepad.exe d:\wxsim\readydat.txt" (including the quotes) but it simply says the system cannot find the file. If I put this text into the run command directly it works!

What am I doing wrong here?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi,

your show code, maybe you missed the blank infront of the $var.

$var = "c:\Downloads\readme.txt"
Run("notepad.exe " & $var)

So long,

Mega

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Hi,

your show code, maybe you missed the blank infront of the $var.

$var = "c:\Downloads\readme.txt"
Run("notepad.exe " & $var)

So long,

Mega

Well I just did another test (which I thought I'd done before and it works!!! I just removed the quotes from the variable.

So I fixed my own problem. That's how it goes I suppose.....

Share this post


Link to post
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
Sign in to follow this  
Followers 0