broadstairs Posted October 6, 2006 Share Posted October 6, 2006 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? Link to comment Share on other sites More sharing options...
Xenobiologist Posted October 6, 2006 Share Posted October 6, 2006 (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 October 6, 2006 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 Link to comment Share on other sites More sharing options...
broadstairs Posted October 6, 2006 Author Share Posted October 6, 2006 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..... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now