Jump to content
MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. ×

[BTACH] 'SET Va=St' with '& ECHO' doesn't work


Recommended Posts

So - as expected  - you don't really need to set the variable at all and additionally you have no particular limitation in the complexity or length of the command string.

 

jaclaz

Link to post
Share on other sites

I'm using this command multiple times and it makes it easier to edit and to find typos and i will also using this code in a different scenario. ;)

Edited by Outbreaker
Link to post
Share on other sites

Surely that's what the [strings] section is designed to do!

[Strings]EmptyFolder = "PathTo\MyDir"

Then you may be able to just do this!

PUSHD %EmptyFolder%&&RD/S/Q %EmptyFolder%
Link to post
Share on other sites

Then you may be able to just do this!

.. and thus here goes yet another demonstration of the futility of falling in the xyz issue, if Outbreaker had since the beginning explained what his ACTUAL GOAL was and provided the needed context information, not only he would have had a valid solution faster, but it would have been better and simpler. :thumbup

 

jaclaz

Link to post
Share on other sites

Well, you are in the (common BTW) issue of mis-communicating, the known xyz or the chocolate covered banana:

http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/put-down-the-chocolate-covered-banana.html

 

You want to reach a goal, but you do not specify it and ask a question related to a tiny bit of what you believe to be the way to reach that goal (which may or may not the "right" way)

...

Am I missing something?

...

Not yet.

 

Till now the usual screenplay has been followed to the letter:

  • someone asks something about batch
  • jaclaz provides a possible solution
  • Yzöwl provides another (often better) one :yes:
at this point normally Gunsmokingman enters the scene and posts a .vbs to the same effect of the batches/snippets posted earlier,

...

Strangely, I think I really am missing something!

 

...the point!

...

You are not missing it :no:, it simply does not exist :w00t:, the whole point of the game, when played outside common rules, is to continuously shift the actual question towards something else at each iteration.

 

The original question made some sense, but as soon as a "normal" solution (actually two) were proposed, the question became different (having no actual practical use) and I suspect that even the modified question has very little in common with the actual goal/expected result/intended use, hence the reference to the xyz issue.

...

...but you're setting a variable for no reason

...

I am still failing to see the actual practical use of this command, I mean is it to be included in a batch file or - as it seems - it is intended to be typed on the command line?

...

So - as expected - you don't really need to set the variable at all and additionally you have no particular limitation in the complexity or length of the command string.

...

Then you may be able to just do this!

...

.. and thus here goes yet another demonstration of the futility of falling in the xyz issue, if Outbreaker had since the beginning explained what his ACTUAL GOAL was and provided the needed context information, not only he would have had a valid solution faster, but it would have been better and simpler.

 

LOL GSM and I have had similar "adventures" with Outbreaker, with similar results. Unfortunately, this thread was indeed as expected. :)

Cheers and Regards

Link to post
Share on other sites

Throwing this in the mix. Put the echo first then set.

@echo off echo|set /p"FN=FolderName"Pause

 

…unfortunately however, the actual task did not involve outputting anything at all to the screen!

 

Oh and also Outbreaker, since you are invoking the commands from an inf, there should also be no reason why you need to join all of the commands into a single line.

11,,cmd.exe,,,"/Q/C ""FOR /F ""DELIMS="" %A IN ('DIR/B/AD ""%ProgramFiles%\Software\temp\""') DO RD/S/Q ""%A"""11,,cmd.exe,,,"/Q/C ""DEL/F/Q/A ""%ProgramFiles%\Software\temp\*.*"""
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...