XCOPY is a powerful command with multiple options. Use XCOPY to copy over a directory and it’s sub-folders without the files.
View XCOPY options
The following XCOPY copies over just the directory structure without the files in the folder.
C:\Temp>XCOPY c:\Temp\ZipTest C:\Temp\NewZipTest /T /E
If you’ve reverse-engineered an existing database and then made updates to the physical database here is how you can refresh the model.
- Select the Main Model under the Physical option on the Data Model pane.
- Right-click on the model diagram and choose the Compare and Merge utility option.
- Choose the Compare against a live database option.
- Choose the following prompts according to your needs. At the end you will see the differences between the physical model and the database and have the options to import or ignore the objects.
So I was asked if I could execute a batch file after an ETL was complete. The batch file to be executed resided on a remote server. The process currently involves a scheduled SQL job that first executes a SSIS package and then a stored procedure. Here are the steps I performed to be able to achieve this.
- On the remote server perform the steps as detailed in this Microsoft article Setting up Remote WSH.
- Create a BatToCall.bat batch file that will reside on the remote server. This is the batch file that we are going to execute remotely.
- Create a ExecuteRemotely.wsf script file. This script file will reside locally where the task is being executed but when called will perform the stated operations remotely.
- Create a Caller.wsf script file that will be called from the SQL job. This script file in turn will call the ExecuteRemotely.wsf script file.
- Create a SQL job with a step of type “Operating system (CmdExec)”. In the command, type “CScript Caller.wsf”. (The CScript command can be run from the command-line as well.)
- Execute the SQL job with appropriate permissions in place should execute the remote batch file.
Here is sample code for the above mentioned files.
echo | time > C:\ExecutedHere.txt
set oController = CreateObject("WSHController")
set oProcess = oController.CreateScript("C:\ExecuteRemotely.wsf", "\\RemoteServerName")
WScript.ConnectObject oProcess, "remote_"
While oProcess.Status <> 2
Set theError = oProcess.Error
WScript.Echo "Error " & theError.Number & " - Line: " & theError.Line & ", Char: " & theError.Character & vbCrLf & "Description: " & theError.Description
set WShell = CreateObject("WScript.Shell")
Set WShell = nothing
When I needed space at the top of a OneNote page that already had a bunch of notes I used to go through the pain of moving each note around to create more space. However, today I found this cool menu option under the “Insert” menu option called “Extra Writing space”. Use that to insert or reduce space between your notes.
Choose the menu option and move your mouse over your page. You will see either a horizontal or a vertical line appear depending on the location of the mouse cursor over the page. Left-click the mouse button, hold and drag appropriately to add or reduce space on the page. If you perform this operation in the middle of a note I noticed it splits the note into two.