执行命令,获取输出并使用它(Executing command, getting output and using it)
我正在尝试执行一个超出命令的Windows批处理文件,并向其传递一个作为批处理文件的参数接收的流程参数,然后我需要获取此执行的输出并在发送之前对其执行某些操作批量输出(剪切输出以仅获取第一个字符)。 这是我到目前为止:
for /f %%i in ('"C:\Program Files (x86)\JAM Software\SpamAssassin for Windows\spamc.exe" < %1') do set RES2 = %%i ECHO %RES2~0,1%
但它没有按照我的预期运作。 谢谢您的帮助。
I'm trying to do a Windows batch file that excecute a command and pass to it a flow param that is received as a parameter of the batch file, then I need to get the output of this execution and do something with it before sending it to the batch output (cuting the output to get the first character only). This is what I have so far:
for /f %%i in ('"C:\Program Files (x86)\JAM Software\SpamAssassin for Windows\spamc.exe" < %1') do set RES2 = %%i ECHO %RES2~0,1%
But it is not working as I expect. Thanks for the help.
原文:https://stackoverflow.com/questions/21911262
最满意答案
当前版本的Spring会话不支持到期配置。
这是github上的问题: https : //github.com/spring-projects/spring-session/issues/106
The current version of spring session doesn't support expiration configuration.
Here is the issue on github: https://github.com/spring-projects/spring-session/issues/106
相关问答
更多-
如果你不介意改变CookieSpec你可以提供你自己的,更宽松的子类。 首先,创建一个宽松的CookieSpec ,它将接受expires属性的空值和空值,如下所示: class LenientCookieSpec extends BrowserCompatSpec { public LenientCookieSpec() { super(); registerAttribHandler(ClientCookie.EXPIRES_ATTR, new BasicExpi ...
-
我遇到了一个缓存问题,它阻止了我的会话cookie在开发者控制台中显示并被应用。 擦除浏览器历史记录并重新启动计算机后,它清除了缓存。 最终我得到它与以下工作: from webapp2 class MainHandler(webapp2.RequestHandler): def get(self): the_value = ''.join(SystemRandom().choice(string.digits _ string.ascii_lowercase) for_in r ...
-
我不认为有直接的方式来了解这一点。 我们用来在母版页上做这个JavaScript hack。 请注意,手动设置cookieExpiryTime。 var timeoutID, cookieExpiryTime = 20 * 60 * 60; //20 minutes function HandleSessionExpiry() { timeoutID = window.setTimeout(function () { window.location.href = 'http: ...
-
我找到了解决上述问题的方法。 追加: else Session.Add("dummy", 0); 解决了这个问题,虽然看起来确实有点不正统。 似乎空会话无法更新会话cookie中的会话ID。 I found a fix for the above mentioned problem. Appending: else Session.Add("dummy", 0); solves the problem, although it does seem a bit unorthodox. It ...
-
当前版本的Spring会话不支持到期配置。 这是github上的问题: https : //github.com/spring-projects/spring-session/issues/106 The current version of spring session doesn't support expiration configuration. Here is the issue on github: https://github.com/spring-projects/spring-sessio ...
-
你不能。 会话标识位于URL中,而不是在浏览器中。 复制URL时,还会复制会话标识,关闭浏览器不会更改您复制的URL。 You can't. The session identity is in the URL, not in the browser. When you copy the URL, you also copy the session identity, and closing the browser doesn't change the URL that you copied.
-
MemoryStore是默认的,它非常简单,并且它不支持TTL。 源代码 如果你想访问MemoryStore,就这样做: var ms = new MemoryStore(); app.use(express.session({ store: ms ... }))' ms.all(function (err, array_of_session) { console.log(array_of_session); }); 您应该使用redis或mongo来存储会话。 例如connect- ...
-
显然,库被迫写入cookie以使其在会话结束时到期。 好消息是,在此之前它会读取现有的cookie,因此您可以在每次初始化调用之前提供它。 强制库将瑞典语页面翻译成英语: function googleTranslateElementInit() { var ckDomain; for (var ckDomain = window.location.hostname.split("."); 2 < ckDomain.length;){ ckDomain.shift(); } ckDo ...
-
cookie-session maxAge未设置,始终在1年后到期(cookie-session maxAge is not set, always expires in 1 year)[2022-10-12]
根据cookie-session的文档, options对象是平的。 您添加了包含值的其他密钥cookie 。 根据文档,选项应该是 var sessionOptions = { name: 'cookie_name', secret: 'top secret', httpOnly: true, maxAge: expiryDate } express-session中间件期望cookie选项位于关键cookie 。 According to the documentation of c ... -
不要使用expires ,而是尝试max-age (以秒为单位)。 这不涉及创建和修改Date实例。 if (document.cookie.indexOf('visited=true') === -1) { document.cookie = "visited=true; path=/; max-age=2592000;"; Instead of using expires, try max-age (in seconds). This doesn't involve the creation ...