I am working on an auto-install script for where I work and we have a ClickOnce type application we use from a vendor. I have looked into it and we can't automate the install but we would like to be able to at least start the install automatically.
I have tried
rundll32.exe dfshim.dll,ShOpenVerbApplication "%SOFTWARE%\ToolsApp.application"
but it gives me an error about an invalid URI.
What would probably be the easiest is to use whatever program Windows has (Windows XP in our case) to run the default "handler" for the file. I don't know if any such thing exists, but that is what comes to mind.
I have two .rtf file....
The first one have this content:
Apple, Orange, Banana, Noodle, Chip
The Second File is something like this:
Apple I love eat Apple.
Banana I hate Banana.
Zoo I want to go Zoo.
Noodle Noodle can be a very very very very very very very very very very very long, but still is one line.
Chip Don't eat so many chip.
Orange Orange is great, not Apple plx. Noodle
Water Drinking water is boring.
The first file is a "key" of second file. In the second file, the first word is the key of each line. Each key and sentence in second file ONLY have one line. The Second File have many lines with key, but not all the key is shown on file1, but file1's key MUST in the second file.
How can I get the result like this: (Need to sort by the key from File1)
Apple, Apple I love eat Apple.
Orange, Orange is great, not Apple plx.
Banana, I hate Banana.
Noodle, can be a very very very very very very very very very very very long, but still is one sentence.
Chip, Don't eat so many chip.
is there anyway to convince mput to send all sub directories of the current directory to the server. Im trying to write a script to automatically update a website when it is run. So far ive been trying
mput *
but that only sends the files in the current directory.
Any help would be appreciated.
Given this example folder structure:
/folder1/file1.txt
/folder1/file2.djd
/folder2/file3.txt
/folder2/file2.fha
How do I do a recursive text search on all *.txt files with grep from "/"?
("grep -r <pattern> *.txt" fails when run from "/", since there are no .txt files in that folder.)
There must be a way to control the built-in VPN client in OS-X Snow Leopard, I simply can't find documentation about it. I want to be able to connect and disconnect while I'm ssh'd into my box remotely. Does anyone know how to do that?
I have a folder named "C:\Jobs\job#1" , "C:\Jobs\job#2" "C:\Jobs\job#3" etc and a lot of directories and sub-directories under it.
I want to get the all the directories under Jobs and xcopy them to C:\backup.
Then I want to xcopy all the files under each Job#1, 2 ,3 etc. to C:\backup\job#1\month\\*.*
To make it clearer.
Source dir = C:\Jobs\job#1\"myfiles&dir"
Destination dir = C:\Backup\job#1\month\"myfiles&dir"
then do the next folder
Source dir = C:\Jobs\job#2\"myfiles&dir"
Destination dir = C:\Backup\job#2\month\"myfiles&dir"
...until all folders are back-up. Since the job folder keep increasing, by doing it this way I don't have to add extra code on this script except modify the month. Thank you.
I'm trying to setup rsync to backup a remote directory to my local drive.
I cd to the directory that I want to pull the files to, then I enter:
rsync -vrtW [email protected]:~/public_html
I enter the password then it starts running. I get all the files listed, but none of them actually transfer. What am I missing?
Thanks
Is this possible with rsync?
Transfer everything from src:path/to/dir to dest:/path/to/other/dir and delete some of the source files in src:path/to/dir that match a pattern (or size limit) but keep all other files. I couldn't find a way to limit --remove-source-files with a regexp or size limit.
Update1 (clarification): I'd like all files in src:path/to/dir to be copied to dest:/path/to/other/dir. Once this is done, I'd like to have some files (those that match a regexp or size limit) in src:path/to/dir deleted but don't want to have anything deleted in dest:/path/to/other/dir.
Update2 (more clarification): Unfortunately, I can't simply rsync everything and then manually delete the files matching my regexp from src:. The files to be deleted are continuously created.
So let's say there are N files of the type I'd like to delete after the transfer in src: when rsync starts. By the time rsync finishes there will be N+M such files there. If I now delete them manually, I'll lose the M files that were created while rsync was running.
Hence I'd like to have a solution that guarantees that the only files deleted from src: are those known to be successfully copied over to dest:. I could fetch a file list from dest: after the rsync is complete, and compare that list of files with what I have in src:, and then do the removal manually. But I was wondering if rsync can do this by itself.
I'm trying to install VMware-vSphere-CLI-5.0.0-422456.x86_64 onto CentOS 6.0 64bit, but the installer complains:
CPAN not able to install following Perl modules on the system. These must be
installed manually for use by vSphere CLI:
UUID 0.03 or newer
I tried to do
sudo yum install uuid-perl
and also
sudo yum install perl-SOAP-Lite perl-Data-Dump perl-Class-MethodMaker perl-Crypt-SSLeay perl-libxml-perl perl-XML-LibXML-Common
but this doesn't help.
What else can I try to do?
I have a dev copy of a website set up that has quite a few hardcoded references to its live counterpart.
I would like to replace all occurrences of "www." with "dev." in all files.
I think I can use a combination of grep + sed, but I'm not sure how.
I have a Ubuntu Server VPS and I want to use /bin/bash/ as my shell. How can I change my shell? I have root access but I don't work as root. So dash is my default shell now.
I have read How do I make Bash my default shell on Ubuntu? and chsh seams to be the preferred way to go. But when I type chsh /bin/bash I get this message:
chsh: unknown user /bin/bash
And if I just type /bin/bash the Bash shell seams to work fine. How to change it?
My bash scripting knowledge is very weak that's why I'm asking help here. What is the most effective bash script according to performance to find and copy files from one LINUX server to another using specifications described below.
I need to get a bash script which finds only new files created in server A in directories with name "Z" between interval from 0 to 10 minutes ago. Then transfer them to server B. I think it can be done by formatting a query and executing it for each founded new file "scp /X/Y.../Z/file root@hostname:/X/Y.../Z/" If script finds no such remote path on server B it will continue copying second file which directory exists. File should be copied with permissions, group, owner and creation time.
X/Y... are various directories path. I want setup a cron job to execute this script every 10 minutes. So the performance is very important in this case.
Thank you.
Hello, I have a folderA that contains folderB that contains alot of files. I would like to get rid of folderB, but not its contents. I want those contents to be inside of folderA. How can I accomplish this on the commandline?
When trying to use the method below to send message in Windows 7 nothing happens.
net send
It seems the Messenger Service is not working. Any suggestions as to why?
When I run terminal using the icon on my desktop, I get this error:
-bash: export: `:/System/Library/Frameworks/Python.framework/Versions/2.6/bin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin': not a valid identifier
And subsequently, no commands are working (ls, ssh, sudo, rm, cp and so forth).
What is happening???
I am trying to modify my CMD, to show only current dir name dynamically
like:
Desktop $
When i switched the folder, it must be updated.
It is not required to be code in purely batch file, it may depend any external commands, cygwin bash, etc.
@echo off
set a=bash -c "pwd | sed 's,^\(.*/\)\?\([^/]*\),\2,'"
%a%
cmd
outputs
_test-et
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. Tüm haklari saklidir.
>>
But
>> prompt %a%
gives
bash -c "pwd | sed 's,^\(.*/\)\?\([^/]*\),\2,'"
I want to delete some files/directories from my Time Machine Partition using rm, but am unable to do so. I'm pretty sure the problem is related to some sort of access control extended attributes on files in the backup, but do not know how to override/disable them in order to get rm to work. An example of the error I'm getting is:
% sudo rm -rf Backups.backupdb/MacBook/Latest/MacBook/somedir
rm: Backups.backupdb/MacBook/Latest/MacBook/somedir: Directory not empty
rm: Backups.backupdb/MacBook/Latest/MacBook/somedir/somefile: Operation not permitted
There are a number of reasons I do not want to use either the Time Machine GUI or Finder for this. If possible, I'd like to be able to maintain the extended protection for all other files (I'd like not to disable them globally, unless I can re-enable once I've done my work).
I have large text files with space delimited strings (2-5). The strings can contain "'" or "-". I'd like to replace say the second space with a pipe. What's the best way to go?
Using sed I was thinking of this:
sed -r 's/(^[a-z'-]+ [a-z'-]+\b) /\1|/' filename.txt
Any other/better/simpler ideas?
Thank you
I am trying to get the values from a file which has duplilcates also. But while setting the values in environmental variable SET, it is not considering the duplicate values. I am using below code:
for /f "tokens=1,2 delims=@" %%a in (test.txt) do (
set size=............%%b
call set %%size:~-12%%=%%a
)
for /f %%a in ('set .') do >>outfile.txt echo %%a
Format of test.txt:
"C\ab"@12345678
"C\ab\we"@345678905
"C\ad\df"@345678905
I'm having problems with iptables. I am trying to block port 80 from the outside, basically plan is we just need to Tunnel via SSH then we can get on the GUI etc. on a server
I have this in my rule:
Chain OUTPUT (policy ACCEPT 28145 packets, 14M bytes)
pkts bytes target prot opt in out source destination
0 0 DROP tcp -- * eth1 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 state NEW,ESTABLISHED
And
Chain INPUT (policy DROP 41 packets, 6041 bytes)
0 0 DROP tcp -- eth1 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 state NEW,ESTABLISHED
Any guys wanna share some insights?
I have a problem with Windows 7 and cmd.exe with these conditions:
Logon as non admin user
Launch cmd.exe
I can see cmd.exe in task manager but it's invisible in the desktop and I don't know what to do, everything is fine and I can see cmd.exe if I do login with an admin account. I can see it in the "Process" tab but not in the "Application" tab, and if I launch five cmd.exe's, I see five processes, but from that tab I have no "Bring to front" or "Maximise"
I can't find any WOW folder under C:\Windows, even with show hidden and system files enabled.
I'm running Windows 7 32-bit running on a 64-bit Intel Core 2 Duo E7500
I'm trying to run a couple of 16-bit legacy DOS programs from a standard windows XP dos prompt. The problem is that the file extensions have been renamed from .COM to .COS and they are stored on read-only media and I can't copy them (special environment).
Any tips on how to invoke such files despite the weird extension? If they had been 32-bit EXEs, it wouldn't have been an issue running them even without their proper extensions, but with these COM files, I'm unable to find a way to run them.