Windows batch dynamic URL script - windows

Is there a possibility to set Website URL in dynamic way and open it with batch script? (by using e.g. start chrome "-URL here-")
Example.
I have a link with an excel file, which I want to download:
www.example.com/example_15/example_123.xlsx
and each day specific part of URL is changing, e.g. tomorrow it could be:
www.example.com/example_12/example_abc1.xlsx
Is there any way how I can replace changing parts of the URL so it would always download an excel file ?

Related

Running Excel Scripts on Outlook Attachments then sending processed files

TL;DR: I want to extract an Excel attachment from an Outlook message, automate an Excel script on the unprocessed reports, and then send the output in a new email message.
I have reports from Amazon that I have sent to a specific email on my Outlook folder each month.
I set up Power Automate to trigger whenever an email with an attachment is received in this folder.
I want to take the attachment in this Outlook email and run an Excel script that I build on Excel Desktop (not an Excel application macro) to format the data.
And then I want to send the output/result (scripted email attachment) as the body of an email out to clients.
I've gotten the first and last parts to run, but I can't get the script to process the file, that's the phase that always breaks that automation.
Things that I think might be causing the issue:
Do I need to extract the attachment from the email and save it as a file before I can run the Excel script on it?
Does the attachment need to be saved through Share Point to be later referenced by the Excel script?
Does the script need to be on the same or different cards as previous steps?
I've seen people run the Excel script through a Scope.
I've also looked at every available YouTube video to troubleshoot this: some go over certain steps in the process, but I'm having a hard time threading everything together.
Other Things I've Tried
I also tried to build a macro that does the same thing as my Excel desktop automation, and then wrote VBA code so each time a new sheet is opened the same macro is run, processing the data. But I couldn't get it to run on any new future sheet that I open, even when writing the VBA auto-open code in Module as well as This Worksheet.
I'm open to any method that will make this work.
Get email (V2) - Message ID
#{triggerOutputs()?['body/id']}
Apply to Each - Select an output from previous steps
#{outputs('Get_email_(V2)')?['body/attachments']}
Create File - File Name
#{items('Apply_to_each')?['name']}
Create File - File Content
#{items('Apply_to_each')?['contentBytes']}
Move or rename a file - File (make sure you add .xlsx for Destination File Path)
#outputs('Create_file')?['body/Id']
Run Script - File
#outputs('Move_or_rename_a_file')?['body/Id']
Get file content - File
#outputs('Move_or_rename_a_file')?['body/Id']
Send an email (V2) - Attachments Name-1
#outputs('Move_or_rename_a_file')?['body/DisplayName']
Send an email (V2) - Attachments Content - 1
#body('Get_file_content')?['body']

Trying to get an Oracle report to run to file

I am on Oracle Reports 10g, and I have an RDF that I would like to schedule to run and create a PDF on my local folder. I thought this URL would work:
http://mywebsite.com/reports/rwservlet?server=RptSvr_core2pweb99_asinst_1+userid=myuserid/password#database+report=/home/oracle/middleware/Oracle_FRHome1/forms/v10suite/GL573.rdf+destype=file+desname=c:\temp\GL573.pdf+desformat=pdf+P_unit=26014+P_TTLCOMP_YN=N
My report is on an app server. If I changed the DESTYPE from FILE to CACHE and removed the DESNAME in the URL above, it would create a report in the browser.
Please advise, what am I missing?
OR, is there some way to create a report executable that I can run from my Windows 7 PC to create a PDF? (I was able to do this on Windows XP with RWRUN.)
Only problem is of using wrong concatenation operator + which should be &, instead, before parameter names as in the following string :
http://mywebsite.com/reports/rwservlet?
server=RptSvr_core2pweb99_asinst_1
&userid=myuserid/password#database
&report=/home/oracle/middleware/Oracle_FRHome1/forms/v10suite/GL573.rdf
&destype=file
&desname=c:\temp\GL573.pdf
&desformat=pdf
&P_unit=26014&P_TTLCOMP_YN=N
P.S. without spaces inside string as in your case.

Play! Framework 2.1.3 pdf problems

so I am working on a school project in which we have designed a web application that takes in much user info and creates a pdf then should display that pdf to the user so they can print it off or save it. We are using Play! Framework 2.1.3 as our framework and server and Java for the server side. I create the pdf with Apache's PDFbox library. Every thing works as it should in development mode ie launching it on a localhost with plays run command. the issue is when we put it up to the server and launch with plays start command I it seems to take a snapshot of the directory (or at least the assets/public folder) which is where I am housing the output.pdf file/s (i have attempted to move the file elsewhere but that still seems to result in a 404 error). Initially I believed this to be something with liunx machine we were deploying to which was creating a caching problem and have tried many of the tricks to defeat the browser from caching the pdf
like using javascript to append on a time stamp to the filename,
using this cache-control directive in the play! documentation,
"assets.cache./public/stylesheets/output.pdf"="max-age=0",
then I tried to just save the pdf as a different filename each time and pass back the name of that file and call it directly through the file structure in the HTML
which also works fine with the run command but not the start.
finally I came to the conclusion that when the start command is issued it balls up the files so only the files that are there when the start command is issued can be seen.
I read the documentation here
http://www.playframework.com/documentation/2.1.x/Production
which then I noticed this part
When you run the start command, Play forks a new JVM and runs the
default Netty HTTP server. The standard output stream is redirected to
the Play console, so you can monitor its status.
so it looks like the fact that it forks a new JVM is what is causing my pain.
so my question really is can this be gotten around in some way that a web app can create and display a pdf form? (if I cannot get this to work my only solution
that I can see is that I will have to simulate the form with HTML and fill it out from there) --which I really think is a bad way to do this.
this seems like something that should have a solution but I cannot seem to find or come up with one please help.
i have looked here:
http://www.playframework.com/documentation/2.1.x/JavaStream
the answer may be in there but Im not getting it to work I am pretty novice with this Play! Framework still
You are trying to deliver the generated PDF file to the user by placing it in the assets directory, and putting a link to it in the HTML. This works in development mode because Play finds the assets in the directory. It won't work in production because the project is wrapped up into a jar file when you do play dist, and the contents of the jar file can't be modified by the Play application. (In dev mode, Play has a classpath entry for the directory. In production, the classpath points to the jar file).
You are on the right lines with JavaStream. The way forward is:
Generate the PDF somewhere in your local filesystem (I recommend the temp directory).
Write a new Action in your Application object that opens the file you generated, and serves it instead of a web page.
Check out the Play docs for serving files. This approach also has the advantage that you can specify the filename that the user sees. There is an overloaded function Controller.ok(File file, String filename) for doing this. (When you generate the file, you should give it a unique name, otherwise each request will overwrite the file from a previous request. But you don't want the user to see the unique name).

Using hardcoded pac script in Firefox

I am currently trying to port a chrome extension to firefox (addon-sdk). However I came up with a few problems porting the pac script functionality.
When setting a proxy through chromes extension API, you can set a PAC script as string inside the pac script object (ref: http://developer.chrome.com/extensions/proxy.html#type-PacScript)
Looking in Firefox, there is nothing like that. The only option I see is to pull the script from a url (http://kb.mozillazine.org/Firefox_:FAQs:_About:config_Entries). My problem with this is that the pac script have to change and react when the user adjust addon settings.
Is there a (hacky) way to accomplish something like that in Firefox?
The only solution I came up with is encoding the users options and post them to the pac script server. Server parses them and creates a script matching the needs. I want to avoid using servers at any costs as this results in another dependency!
You can use a data: URI for your PAC file. Generating it dynamically is easy:
var pacScript = "function FindProxyForURL(url, host){return 'DIRECT';}";
var uri = "data:text/javascript," + encodeURIComponent(pacScript);
alert(uri);

I'm told to down load a text file from another website and to put in the root directory of my website

I want to know how to down load a text file from another website and how to put it in the root directory of my website.Can you help me with problem please.THANK'S !!
As a program, or as a human action?
As a human, you should be able to take the link and download the file, upload to your website using for example FTP or (hopefully no one does this now) frontpage.
If you mean programattically, well its almost the same. Your script would need to open the file in the root directory, open the URL and read in the data sent and save it to the file, close the file. However, how to do so exactly depends on the lanugage you want, is this a repeated event or a once off?
This type of request usually happens when you are requesting a service that requires proof that you are the website owner. Being the owner of that website would also indicate that you should have at least ftp access over your site. If you are hosting the website yourself, this is an easy task you just copy the file into the root directory (windows default is c:\inetpub\wwwroot, ubuntu default is /var/www/). However if your website is hosted, you need to find your ftp username and password and utilize an ftp program like FileZilla. If you want to tell us what file host you use maybe someone can give you exact instructions. But beware of what file you host.
If you have the URL of the text file you can put it into your browser and then save the file to your disk. You then need to FTP it to your web server (or whatever method you normally use to get files onto the server)
In PHP:
<?php
$resource = curl_init('http://www.someserver.com/file.txt');
// important, otherwise curl_exec will output directly
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$data = curl_exec($resource);
curl_close($resource);
file_put_contents('/dir/localfile.txt', $data);
Or even better, with a bash script with a simple wget and cp.

Resources