Home > Software engineering >  About the procedure call command SHELL
About the procedure call command SHELL

Time:10-04

I want to click a button, open the specified file, so just use the following command:
Shell (" C: \ Windows \ system32 \ notepad exe "+" "+ newdate)

But the problem is that the file with the date command, every day is different, I have set to variable newdate, and will change with the different dates, but the above command executes, he executed the file name is not I want to file, if I quotes, becomes the "newdate. TXT",

Ask, how to describe this file, to become a will continue to change the file name? Or in other orders?

CodePudding user response:

Estimates is the right path, you try to add the full path

CodePudding user response:

 Shell "C: \ Windows \ system32 \ notepad exe" "" & amp; Format (Date, "yyyy - mm - dd") & amp; "" ". TXT" 

CodePudding user response:

 Shell "C: \ Windows \ system32 \ notepad exe" "" & amp; "D: \ mydir " + "prefix" + Format (Date, "yyyy - mm - dd") & amp; ". TXT "" "

CodePudding user response:

 Shell "C: \ Windows \ system32 \ notepad exe" "" & amp; "D: \ mydir " + "prefix" + Format (Date, "yyyy - mm - dd") & amp; ". TXT "" "

In front of the building 3 D: \ one more Spaces,

CodePudding user response:

To solve, thanks!
My code is right, just newdate this variable is set when the error!
  • Related