Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • I have updated the question adding more details of first.bat. thanks
    – acgbox
    Commented Oct 28, 2022 at 13:09
  • Change cannot be dynamic in second.bat, but permanent
    – acgbox
    Commented Oct 28, 2022 at 13:11
  • Changing it to dynamic one time, is "permanent" then no need to edit "content" of second.bat but that one time only to specify the name of the variable up top set to the argument value that's passed it, then that variable in hundred or thousands of lines below will be just that value everywhere for the exact result you need. This is a classic example here actually. You'd just add before (or after) the echo input line second.bat "%dbuser%" "%dbpass%" "%dbname%" . @acgbox Commented Oct 28, 2022 at 14:51
  • Then you'd only add three new lines in second.bat just one time and no need to change or add anything else ever. Just add the three lines set "dbname=%~1", set "dbuser=%~2", and set "dbpass=%~3" to second.bat. Now run it and everything should work/connect to SQL as expected from form specified input setting variable output to be another script variable input. Is the issues the user specifying input does not have execute access themselves to execute second.bat or are they not able to make the SQL connections themselves and another process executes that. Task Scheduler will help here Commented Oct 28, 2022 at 14:52
  • 1
    I will adapt my script to this new reality. Thank you
    – acgbox
    Commented Oct 28, 2022 at 21:57