Can I execute a remote placed .vbs file using wscript command? - windows

I have tried using the wscript command with local file share and it works perfectly.
Ex: wscript \\192.168.10.1\script\hello.vbs
Is there any way I can run the file from remote HTTP server?
Something like: wscript http://192.168.10.1/script/hello.vbs
TIA

wscript.exe does not support calling VBScripts directly from an URL. Why not use the FTP server?
Why do you want to use the HTTP?
An solution for you could be, if you have it hosted on an NAS, try to open ports so that you can access it from your IP adres.
I could help you with it if you need it, but you need to give some more details about the hardware (NAS/Router)

Related

Daily upload of file automation using batch script and WinSCP

So I do have a file that I generate weekly from a server using crontab in Linux side and transfer it to my PC. However, I am having a problem when try to send the file that I generate from a different server on Windows side using task scheduler.
Your command-line syntax is wrong.
I'm assuming the \ftpBinverlog_%yyyy%-%mm%-%dd%.txt is the file, you want to download.
It won't work, if you just specify it on command-line like you did.
Also neither Windows scheduler, nor command-interpreter, nor WinSCP understand syntax like %yyyy%.
The path to the remote file does not look good either. *nix systems use forward slashes, not backslashes.
So just keep your /script and /log arguments:
/script=C:\batchrun\Binver\script.tmp /log="C:\BIN VERIFICATION\ftplog"
And make sure the script.tmp looks like:
open sftp://user#example.com
get /ftpBinverlog_%TIMESTAMP#yyyy-mm-dd%.txt C:\target_path\
exit
References:
Guide to automating file transfer from SFTP server
%TIMESTAMP syntax.
Develop a batch file which will download/upload the required file using the SCP command
check this for more details.
check this for more details about the scp command parameters.
Make sure that you are able to run the batch with a successful result, then configure it within a scheduled task.
I hope this could help.

Change ftp folder permission via command line

I'm using windows command line MS FTP for ftp access. However I furthermore must change folder permission via command line as well. I tried CACLS command, alas that doesn't work in open ftp commmand window. Any hint's appreciated
You should be able to change permissions if you use a good GUI client.
Give the following a try and let us know if it works for you!
Filezilla
FTP Commander
FTP is an Internet standard designed by people who work together to a common goal. CACLS is a pile of Microsoft-invented stuff that FTP knows nothing about so that is not going to work unless someone implements a QUOTE command to pass it through. The nearest you can get to changing permissions is with the CHMOD command.

How to change remote file permission via FTPClient

I need to handle remote file on a ftp server via commons-net-1.4.1.jar,class org.apache.commons.net.ftp.FTPClient.It's seems that no api available to change a file's permission,just like unix shell command chmod.
Anyone know any solution to resolve this issue?
FTP doesn't have a command for such operations, since the operation is platform-specific. If your library supports this, you can try using SITE command and pass the command line as a parameter of SITE command. Some servers support this trick to run shell commands.

windows batch file to copy a file from a server to local

I would like to write a little code that copy on a local pc a file from another (a server).
Which Windows batch file function I can use to write this little batch file program, (FTP maybe?)
And also to visualize a message on my pc (the local pc)
thanks for all
Just use wget.
It can be called from your batch file and will download from HTTP and FTP.
Write SHUTDOWN -i in a note pad then save to desktop and name it anything but it must have .bat at the end and then click save and u can shutdown any computer in you server.

DOS : how do you run a batch without having to login on a share?

I'm running an xcopy command in a batch script which copies a file to a shared drive on another workstation; however the workstation requires a login before connecting to the share. Is there a way to script the login/connect into the batch file?
thanks in advance
You can use the "net use x:\servername\sharename /u:username password" command to login to the share within the batch file. However putting the password into a plaintext batch file is generally a bad idea.
You can use net use to map a temporary drive and login using the credentials. This is what we had to do. Perhaps there is a better way. Then at the end of the script we unmap the drive.
Here is a link to the net use command: http://www.cezeo.com/tips-and-tricks/net-use-command/

Resources