批处理文件:相对路径出错,从当前目录向上一级(Batch File: Error in relative path , one level up from the current directory)
我是批处理脚本编程的新手。如果给出相对路径,执行批处理文件时出现错误。 我有以下文件夹结构
Script folder - C:\batch\script\ServiceRegister.bat Bin path - C:\batch\bin\ERecruitGenerateReportsWindowsService.exe
ServiceRegister.bat批处理文件 -
%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe %~dp0%~1\bin\ERecruitGenerateReportsWindowsService.exe
当我执行ServiceRegister.bat文件时出现错误:
Exception occurred while initializing the installation: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\batch\script\bin\ERecruitGenerateReportsWindowsService.exe' or one of its dependencies. The system cannot find the file specified.
我正在使用“%〜dp0%〜1”在目录中上升一级,但它仍然获得当前路径。
%~dp0%~1 - C:\batch\script\
我需要C:\ batch \路径。 我如何才能获得这条道路? 它工作正常如果我给绝对路径 -
%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe C:\batch\bin\ERecruitGenerateReportsWindowsService.exe
I am new to the batch script programming.Getting error while executing batch file if I give the relative path. I have following folder structure
Script folder - C:\batch\script\ServiceRegister.bat Bin path - C:\batch\bin\ERecruitGenerateReportsWindowsService.exe
ServiceRegister.bat Batch file –
%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe %~dp0%~1\bin\ERecruitGenerateReportsWindowsService.exe
When I execute ServiceRegister.bat file I got the error:
Exception occurred while initializing the installation: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\batch\script\bin\ERecruitGenerateReportsWindowsService.exe' or one of its dependencies. The system cannot find the file specified.
I am using “%~dp0%~1” to go one level up in the directory still it gets its current path.
%~dp0%~1 - C:\batch\script\
I need the C:\batch\ path. How I can get this path? It works fine If I give the absolute path -
%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe C:\batch\bin\ERecruitGenerateReportsWindowsService.exe
原文:https://stackoverflow.com/questions/16960880
最满意答案
你是对的--Mandrill将每个电子邮件收件人视为一封电子邮件。 为每个收件人单独跟踪打开,点击,退回和其他活动,为此,必须向每个收件人发送单独的特定电子邮件。 当您向每个收件人发送相同的内容时,基于每个收件人的跟踪必然要求为每个收件人创建单独的电子邮件。
您有几个选项 - 无论如何,您可能希望使用webhooks将开放,点击等数据传回给您,而不是每次要显示有关消息的信息时都查找该数据。 Webhooks允许您获取数据,添加计数并缓存该数据,除非/直到有额外的打开/点击记录。 在不添加任何元数据的情况下,您可以将一个收件人的唯一邮件ID或系统中的特定“消息”用于递增计数器。
如果您愿意,还可以使用Mandrill中的自定义元数据字段,在发送邮件时传递一些唯一标识符,以便将这100个电子邮件/收件人与系统中的单个邮件相关联。 元数据被存储/跟踪30天,并且也包含在webhook中,因此您也可以以这种方式引用回系统。
You're correct - Mandrill treats each email recipient as a single email. Opens, clicks, bounces, and other activity are tracked individually for each recipient, and in order to do that, an individual, specific email must be sent to each recipient. While you're sending the same content to each recipient, tracking on a per-recipient basis necessarily requires that an individual email be created for each recipient.
You have a few options - regardless, you probably want to use webhooks to have open, click, etc. data passed back to you rather than looking up that data each and every time you want to display information about messages. Webhooks would allow you to get the data, add to your counts, and cache that data unless/until there are additional opens/clicks to record. Without adding any metadata, you can use that unique message id for a series of recipients or a specific "message" from your system to increment your counters.
If you wanted to, you could also use a custom metadata field in Mandrill, to pass some unique identifier when you send a message to associate these 100 emails/recipients with a single message in your system. Metadata is stored/tracked for 30 days, and is included in webhooks, as well, so you can reference back to your system in that way, too.
相关问答
更多-
如果您希望两个收件人都能够看到对方,则可以在“收件人”选项中传递一系列电子邮件。 如果您不希望其中任何一个看到对方,您可以在用户循环中发送所述电子邮件。 如果使用ActionMailer ,可以这样做: mail( to: ['person1@gmail.com', 'person2@gmail.com'] ) 或者循环: [user1, user2].each do |user| UserMailer.some_email(user).deliver_now end mail( to: u ...
-
您无法设置默认的from_address。 每次通过API调用都必须包含它。 您的域名是其他内容,通过添加域名,您可以将其添加到可以通过API与您的Mandrill帐户对话的域名白名单中。 You can't set a default from_address. You will have to include it each time via your API call. Your domain is something else, by adding a domain you add it to th ...
-
你是对的--Mandrill将每个电子邮件收件人视为一封电子邮件。 为每个收件人单独跟踪打开,点击,退回和其他活动,为此,必须向每个收件人发送单独的特定电子邮件。 当您向每个收件人发送相同的内容时,基于每个收件人的跟踪必然要求为每个收件人创建单独的电子邮件。 您有几个选项 - 无论如何,您可能希望使用webhooks将开放,点击等数据传回给您,而不是每次要显示有关消息的信息时都查找该数据。 Webhooks允许您获取数据,添加计数并缓存该数据,除非/直到有额外的打开/点击记录。 在不添加任何元数据的情况下, ...
-
以下代码示例显示如何指定两个收件人,构造一个电子邮件对象并使用该电子邮件对象执行SendSheet操作。 用于指定收件人和构造电子邮件对象的相同技术可以应用于其他发送操作(例如, SendReport , SendRow等)。 // Specify recipients Recipient[] recipients = new Recipient[] { new Recipient { Email = "john.doe@smartsheet.com" }, new Recipient { Emai ...
-
延迟作业和Mandrill:未初始化的常量Mandrill :: API(Delayed job and Mandrill: uninitialized constant Mandrill::API)[2023-05-17]
确保重新启动delayed_job守护程序以获取任何代码更改。 它不会像Rails开发环境那样自动重新加载。 Make sure to restart the delayed_job daemon to pick up any code changes. It does not auto-reload like the Rails development environment does. -
看看sendwithus吧 。 它们在Mandrill之上提供模板管理和发送API,我知道它们支持动态主题行。 文件在这里。 Take a look at sendwithus. They provide a template management and sending API on top of Mandrill, and I know they support dynamic subject lines. Docs here.
-
首先只需通过js SDK使用mandrill API 它可以在这里找到。 var m = new mandrill.Mandrill('api key'); function sendTheMail(){ m.messages.send({ "message": { "from_email": "xx@xx.com", ...
-
我发现你将从下面链接获得所有api及其文档 https://mandrillapp.com/api/docs/index.php.html 借助于此,我解决了我的问题。 谢谢 I found that you will get all api & its documentation from below link https://mandrillapp.com/api/docs/index.php.html With the help of this i resolved my issue. Thanks
-
Mandrill使用相同的电子邮件向收件人发送个性化邮件(Mandrill personalized message to recipients with same email)[2022-10-25]
目前,Mandrill使用电子邮件地址作为API调用中合并变量的唯一标识符,因此只能为电子邮件地址提供一组合并值,即使您在messages.to已多次指定该地址。参数。 如果您有多个唯一的电子邮件要发送给同一个收件人,那么此时应该在单独的API调用中处理。 At this time, Mandrill uses email addresses as a unique identifier for merge vars in API calls, so it's only possible to provid ... -
来自mandrill api doc: 此消息应作为YYYY-MM-DD HH:MM:SS格式的UTC时间戳发送。 如果您指定过去的时间,则会立即发送消息。 预定电子邮件需要支付额外费用,此功能仅适用于余额为正的帐户。 如果我不得不猜测我猜想send_at = time_now需要成为send_at = time_now.to_s以使send_at尊重所需的格式。 Found the answer, you have to include async and ip_pool if you want to u ...