w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
File::Copy move directories accross drives in Windows not working?
Actually, the File::Copy documentation does not state that it's able to move directories at all. The documentation just mentions files. Moving directories on the same partition "accidentally" works, because the rename() function (which is preferred over doing a copy+delete if source and destination are on the same partition) works for both files and directories. BTW, the behavior is the same on Unix systems. If you need a move which is working on directories, then look at CPAN modules like File::Copy::Recursive or File::NCopy.

Categories : Windows

Didn't understand Mr. Stroustup's suggestion to delete the copy default and move operations for the abstract class Shape
He meant that its bad to make them accessible from outside, due to potentioal object slicing problems. It you dont need to make the class clonable than deleting is sufficient, otherwise you can just make it protected to be accessible only within clone() and successors.

Categories : C++

Without using PHP copy function, move file from one folder to another
If you do not want use PHP copy() function for some reason, you can do this like: system('cp /path/to/src_file /path/to/dst_file'); for *nix systems, and system('copy /path/to/src_file /path/to/dst_file'); for Windows

Categories : PHP

Launch a Windows File Explorer window from a webpage
I don't believe this is possible with just HTML / javascript because of permission / security One possibility is to create a ActiveX control to launch Windows Explorer. Building ActiveX Controls for Internet Explorer Wikipedia - ActiveX

Categories : Javascript

How to select file in Explorer without creating unnecessary windows?
If you opened the original window you could use Process.StandardInput Property... This allows you to send additional commands to explorer window once it is already opened.

Categories : C#

Installscript : How to close explorer windows without restart of explorer.exe process?
I'm sure you could call FindWindow and use SendMessage to close the explorer windows but the explorer.exe process will still be running and you'll still have a file lock. Windows Installer can delete locked files on reboot. If you don't want the reboot, you'll have to kill and restart explorer. I know of no other patterns here. FindWindow Example WM_SYSCOMMAND message

Categories : Windows

How to copy and execute a file using Active Directory to a client?
You can use Login scripts or GPOs to deploy Software, but a Software deployment System is of course better... If you have MSIs (and optionaly transforms and patches) you can easily publish them in a GPO. Watch a Video here.

Categories : C#

PHP move/copy temp file into a new directory and rename it ( performance )
Move would be as faster than copy... To move a file use the rename function. To move an uploaded file move_uploaded_file is the way to go. It has a little overhead in that it check and ensures that the file was in fact the result of an upload.

Categories : PHP

Write, execute and delete batch file
You could do something like (untested): for /D /R ... IN ... DO CALL :PROCESS %%d GOTO END ... :PROCESS set thing=%~n1 echo @echo off>%1Desktop.bat call %1Desktop.bat del /q %1Desktop.bat GOTO :EOF ... END: ... etc ...

Categories : Batch File

Is there an file explorer for windows that lets me open multiple tabs programmatically
You can use a tab control. Then you create a new tab and load it with the explorer. There are tabbed file explorers like XYplorer, but I don't know if it will be useful to you. You can also add tabs to windows explorer: http://www.howtogeek.com/howto/28997/add-tabbed-browsing-to-explorer-in-windows-7/

Categories : Misc

Windows Batch File: Look for directory, if not exist, create, then move file to it
You can conditionally create the folder with: if not exist moviesshowname mkdir moviesshowname To move a file into it: move ShowName.Episode.Title.mkv moviesshowname To get more information about these commands, open a command prompt and type: help if and help move

Categories : Batch File

Change file name and move files based on file path in Windows 7
Try this: and then examine renfile.bat in notepad to see if it is right for you. Add more filetypes if you need them. @echo off echo.@echo off> renfile.bat for /f "delims=" %%a in ('dir *.jpg *.png *.gif /b /s /a-d ') do call :next "%%a" echo renfile.bat created pause goto :eof :next set "var=%~1" call set "var=%%var:%cd%=%%" set "var=%var:=_%" >>renfile.bat echo ren "%~1" "%var:~1%" and another batch file to move all the files once they are renamed: @echo off md "c: arget folder" for /f "delims=" %%a in ('dir *.jpg *.png *.gif /b /s /a-d ') do ( move "%%a" "c: arget folder" )

Categories : Windows

Want to execute command on each file in directory one at a time through batch file windows
Im not entirely sure what you mean but try this, it will execute the command once for each file in the current directory and (all subdirectories, but this exact snipets not ideal for subdirectories) ending with the extension .prn: for /r %%a in (*) do ( if %%~xa == .prn ( copy %%~na%%~xa /B \\{$PC}\{$PRINTER} ) ) Tell me if this doesn't work or you want to do this for subdirectories as well. Yours, Mona

Categories : Windows

Search large tar.gz file for keywords,copy and delete
If the file is really 20GB it will take very long to grep in any case. The only advice I can give is to use zgrep. This will save you from having to explicitly uncompress the archive. zgrep PATTERN your.tgz

Categories : Python

How can I access a text file in the project explorer "read, write" which is not in the isolated storage in Windows Phone 7?
I found some resources that useful for you. Read File var resource = System.Windows.Application.GetResourceStream(new Uri("textfile.txt", UriKind.Relative) Write File using (System.IO.StreamWriter writer = new System.IO.StreamWriter(fileName, true)) { writer.Write("Write some text here"); } More information: read file in C# read text file in windows phone write file

Categories : C#

Windows cmd move file to android device
Use ADB (Android Debug Bridge) adb push the_file_you_want_to_push the_directory_on_the_device will push a file (the_file_you_want_to_push) onto the device (in the_directory_on_the_device) To get the name of the_directory_on_the_device, you can use adb shell and ls/cd command to get a path ADB executable is in ADT_DIRECTORY/sdk/platform-tools You can also get a file from Android to your computer using adb pull Hope it helps

Categories : Android

How to Detect File Rename / Move in Windows
If you use java 7, you can simply use WatchService and WatchKey. This is a observer to watch a directory and each time something is changed, created or deleted you can do an action/file handling.

Categories : Java

Vim command to delete lots of entire functions or copy them to other file by RegEx method
Here's how you could delete all functions whose names contain RemoveThisFunction: nnoremap Q /RemoveThisFunction<CR>0v/{<CR>%d Using the above, you could just hit Q a bunch of times until all your functions are gone... If you want more help, you'll have to tell us how you will find the functions you want to delete. If you can assume that the cursor is already at the beginning of the function, you can do the following... Create a mapping that is triggered by pressing FF: :nnoremap FF v/{<CR>% The mapping will do the following: - enter visual mode - search for the next brace - go to the matching brace * You can add a d to the end of the map command to actually delete the text... If you want to use your last search pattern to find the matching text, yo

Categories : Regex

How can I copy and paste a file in Windows using C++?
In native C++, you can use: The CopyFile function : http://msdn.microsoft.com/en-us/library/windows/desktop/aa363851%28v=vs.85%29.aspx CopyFileEx function for more advanced options like progress notifications. http://msdn.microsoft.com/en-us/library/windows/desktop/aa363852%28v=vs.85%29.aspx

Categories : C++

File copy duration in Windows
When you are copying second folder, in that folder large number of files, that should be take much time in compare of first because every file store in seprate sectors in you hard-disk or storage device.

Categories : Windows

How to execute aspx file using windows task scheduler
You can create a VBS file like below Dim iex Set iex = CreateObject("internetexplorer.app location") iex.Navigate "http://www.yoursiteorlocalhost.com/yourpage.aspx?q=1" ie.Visible=True Then schedule the file for execution or use this

Categories : Asp Net

Windows - How to copy one file from each sub-folder (Sampling)
@ECHO OFF &SETLOCAL for /d %%a in (*) do ( SET "folder=%%~a" FOR %%b IN ("%%~a*") DO SET "file=%%~b" SETLOCAL ENABLEDELAYEDEXPANSION COPY "!file!" "X: arget folder" ENDLOCAL )

Categories : Windows

Windows batch - Move files to folders based on file name & extension
EDITED to use different destination folders. Don't use a - in the batch filename if you plan to use it in the same folder. Try this. It uses the first - in the filename as the delimiter, removes the last character which is a space, makes a directory if it needs it or not, and moves the files into the appropriate folder. Filenames containing ! and % could be an issue. @echo off cd /d "c:To-Process" setlocal enabledelayedexpansion for %%a in (*-*.*) do ( for /f "delims=-" %%b in ("%%a") do ( set "f=%%b" if /i "%%~xa"==".pdf" ( md "C:/documents/sales/pdf/!f:~0,-1!" 2>nul move "%%a" "C:/documents/sales/pdf/!f:~0,-1!" >nul ) if /i "%%~xa"==".xlsm" ( md "C:/documents/sales/excel/!f:~0,-1!" 2>nul move "%%a" "C:/documen

Categories : Windows

Batch File Cannot Execute command in Windows 2003 server
You need to either change to the proper drive and folder to execute sm first, or call it directly using a full path. In either case, you need to quote the path because it contains spaces. Changing drive and directory first: cd /d "D:Program Files(x86)PHCheck This 7.11ASDABC" sm -reportlic > D:srini est1.txt Using a full path: "D:Program Files(x86)PHCheck This 7.11ASDABC>sm" -reportlic > D:srini est1.txt

Categories : Batch File

How to execute a bat file from cygwin bash that uses the Windows find command
If you chmod +x your.bat it works. ./your.bat is run via cmd /c Already answered in Why is it that Cygwin can run .bat scripts?

Categories : Batch File

Delete a file named "NUL" on Windows
Try writing a short C program that calls the Windows API to delete that file. http://msdn.microsoft.com/en-us/library/aa363915%28v=vs.85%29.aspx If that doesn't work, try opening a handle to the file with CreateFile() with FILE_FLAG_DELETE_ON_CLOSE, and then close the handle.

Categories : C

Delete file in Windows Store app
Try awaiting the DeleteAsync as well StorageFile sampleFile = await ApplicationData.Current.LocalFolder.GetFileAsync(databaseName); await sampleFile.DeleteAsync(StorageDeleteOption.Default);

Categories : C#

delphi, windows impersonation as user to copy a file
The first suggestion is that you do not have permissions to access the network directory, or the file in question. These could be access permissions or copy permissions (or both). Check that you have permissions to both of these.

Categories : Windows

encrypting a copy of a text file in c# (Windows Forms)
StreamReader/StreamWriter for loading and saving the file. StreamReader: string unencryptedText; private void ReadTextFile() { using (StreamReader reader = new StreamReader("file.txt")) { unencryptedText= reader.ReadToEnd(); } } StreamWriter using (StreamWriter writer = new StreamWriter("encryptedFile.txt", true)) { writer.Write(encryptedText); } Encryption: Simple 2 way encryption for C# Update Chose Directory where to save encrypted file(only Directory) FolderBrowserDialog fbd = new FolderBrowserDialog(); if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { using (StreamWriter writer = new StreamWriter(fbd.SelectedPath+"\encryptedFile.txt", true)) {

Categories : C#

Copy file from Application document directory and move to iPhone /Application folder- Objective C?
I believe you mean /Applications instead of /root/Applications since there is no such folder (at least not on my iOS 5 device). Since /Applications folder has is owned by root with 755 permissions. That means, non-root users can read/execute the files in that folder but not write to it. If you want to write to that folder, you need to run your app as root. The way to do this, somewhat ironically for you, is to have the app installed in /Applications folder. (I think) this is automatically done if you install the app through Cydia. So to sum up: You can't move app to /Applications if you installed it through App Store (or ad hoc distribution). You need to install it through Cydia and it'll be installed directly in that folder. Also, that answer you're referring to in comments, is about M

Categories : Iphone

Intelligent folder in windows using batch file to copy files
Something like this might work: @echo off setlocal set "file=C:path oyour.file" set "destination=D:somefolder" :loop call :GetSize "%file%" s1 call :Sleep 10 call :GetSize "%file%" s2 if %s1% neq %s2% goto loop call :MoveUnlessExists "%file%" goto :eof :GetSize set "%~2=%~z1" goto :eof :Sleep set /a "n=%1+1" ping -n %n% 127.0.0.1 >nul goto :eof :MoveUnlessExists if not exist "%destination%\%~nx1" move "%~f1" "%destination%" goto :eof

Categories : Windows

How to copy/cut a file (not the contents) to the clipboard in Windows on the command line?
You can try Swiss File Knife (SFK): sfk toclip Copy stdin to clipboard as plain text. type test.txt | sfk toclip Copies the content of ASCII file test.txt into the clipboard. sfk list | sfk toclip Copies a file listing of the current dir into the clipboard. sfk fromclip [-wait] [-clear] Dump plain text content from the clipboard to the terminal. -wait : block until plain text is available. -clear: empty the clipboard after reading it. Example: turn backslashes into forward slashes. Imagine you have the following text open within Notepad: foo/bar/systems/alpha1.cpp foo/bar/systems/alpha2.cpp foo/bar/systems/beta1.cpp And for some reason you need the first line in a format like this: fooarsystemsalpha1.cpp Then you may do it this way: Mark th

Categories : Windows

Delete file in IsolatedStorage on Windows Phone 8
This is a bug in the Windows Phone 8 emulator, some times the aplication lost the permissions of her files in the isolated storage. You must delete the application from emulator, and from the visual studio re-implement the app, and try again.

Categories : C#

Porting windows batch file to shell script. If possible execute the task in parallel
I have to admit, I am not sure I fully understand your scenario, but to run tasks in parallel in linux, you can put them in the backgrund using &. Example: start "Engine 1500" ant start & start "Engine 1505" ant start & To call your other script, simply execute it from your first shell script. So in total you would have: clean.sh: #!/bin/sh ant -DCorrelator clean start_parallel.sh #!/bin/sh clean.sh start "Engine 1500" ant -Dengine.port="15800" -Dfamily.one="true" -Dfamily.two="false" start & start "Engine 1505" ant -Dengine.port="15800" -Dfamily.one="false" -Dfamily.two="true" start & Make sure you make both scripts executable using chmod: chmod +x clean.sh chmod +x start_parallel.sh And Linux only looks in your path (echo $PATH) for executable scripts.

Categories : Linux

How to find string in text file with Windows command and copy next 5 characters
Check it out: @echo OFF &SETLOCAL FOR %%f IN (*.txt) DO ( ECHO Processing %%f --^> %%~nf.txt.new (for /f "usebackq delims=" %%a in ("%%~f") do call:doit "%%a")>"%%~nf.txt.new" ) GOTO :EOF :doit SET "line=%~1" SET "first=true" :loop SET "token=" FOR /f "tokens=1*delims=," %%b IN ("%line%") DO ( SET "token=%%b" SET "line=%%c" ) SET "out=%token:~-5%" IF NOT DEFINED first ECHO(%out% SET "first=" IF DEFINED line GOTO :loop GOTO :EOF

Categories : Windows

copy sqlite .db file between between android tablet and desktop running windows 7
1)Create Database on remote server(Say WAMP) 2)Make the following connections- a)Desktop=>Server b)Android=>Server 3)Post your data as a JSON string on server 4)Parse the JSON string and put the records in database on server(You can use PHP) 5)Now you can access this data from server to Desktop as well as in android. 6)As the updated data is on server you don't have to worry about your android and desktop

Categories : Android

ASP.NET C#: Best way to delete a file (image) from windows based server
If deleting the file is possible after resettings the application pool, it seems like you're holding references to the file after uploading it. How do you handle the uploading, and what actions are performed on the file after uploading? Update: I've found some other people with the same problem, the uploaded file stays locked by after calling SaveAs(...): File is locked after HttpPostedFile SaveAs(LocationOnServer). Lastly, it seems the file stays locked until you call SaveAs(...), so if you have some server side validation where you decide wheter to save the file or not, maybe the problem can be there? Note that I did not test this.

Categories : C#

create windows 8 batch file to copy, rename and save files from sub directories recursively
@ECHO OFF &SETLOCAL SET "startfolder=C:pictureskitcam" SET "targetfolder=C:pictureskitcamall" FOR /r "%startfolder%" %%a IN (*.jpg) DO ( SET "fname=%%~nxa" SET "fpath=%%~fa" FOR /f "delims=" %%b IN ("%%~dpa.") DO SET "nname=000%%~nxb" SETLOCAL ENABLEDELAYEDEXPANSION ECHO MOVE "!fpath!" "%targetfolder%!nname:~-4!_!fname!" ENDLOCAL ) Look at the output and remove the word echo before move if it looks good.

Categories : Windows

std::move( ) calls copy-ctor in the absence of a move-ctor. Why and how to prevent it?
Because std::move returns reference to an rvalue (as in A&&) which is not convertible to a reference to an lvalue(A&), but is convertible to a const reference to an lvalue (const A&). int x = 5. Here 5 is an rvalue and can never be bound to an lvalue, and that is also the case in your example because you used std::move(a1)

Categories : C++

Insert, Update, Delete are not applied on SQL Server CE database file for Windows Mobile
Select the releve.sdf database file in your project, go to the Properties section, and make sure Build Action = Content and Copy to Output Directory = Copy if newer. That should be all you need, but if there are other issues you may want to double check the file location: private void button_OK_Click_1(object sender, EventArgs e) { MessageBox.Show(pathDB, "Check Path Location!"); // ... rest of your code }

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.