Running Shell runtime command with spaces from VBA - vba

I'm trying to run the following command in VBA:
Call Shell("C:\Program Files (x86)\Microsoft Office\Office15\MSACCESS.EXE Y:\Sales Team\Sales_Price_Database.accde /runtime").
It fails on the space between Sales and Team. Without that space it works fine.
How can I make it working with the space between Sales and Team?

Related

how to run a file from terminal which executes itself commands in the terminal?

At the moment I've to run the same 2-4x commands within the terminal dozens or even hundred times a day.
Is it possible to call/execute one file only which summarizes all other commands?
The commands are all about building & compiling via cmake, navigating into a folder and run the .exe file

.db file won't open on Visual Studio Code using sqlite3

I have a file in my SQL Directory that I am trying to open using sqlite3 on Visual Studio Code however when I use .open "C:\Users\17724\Documents\SQL\Global_Superstore.db" it will instead create a new file in the Users directory and label it "Users24DocumentsSQLGlobal_Superstore" as a .db file with 0 KB.This is the .db file that is created I emailed this database file from my Macbook so I can open it on my other Windows computer. I know that the file contains the data I'm looking for because I can open it with another program, Tableau, and review the contents. This is the .db file I am trying to open I copied the path name directly from explorer using shift right click so I cannot have made any typos. I am running sqlite3 from terminal in Visual Studio Code.
If you are using WSL (Linux) terminal in VS Code you need to refer to file using its WSL path which is /mnt/c/Users/17724/Documents/SQL/Global_Superstore.db (assuming you did not change where WSL mounts your C: drive).
That file you mentioned is created likely because you already are in your user directory when terminal starts and when you use Windows path backslashes (\) are interpreted by shell as escape sequences.
You can easily figure WSL path of file using command wslpath -a "C:\\Users\\17724\\Documents\\SQL\\Global_Superstore.db" (note doubled backslashes to avoid unwanted escape sequences).

asp.net core gulp path too long

The gulp files installed in a asp.net5 web project use the maximum path length. If you have a project path with more than a few characters long, the folders cannot be deleted.
This post refers to how to build using a short temp directory:
"Path too long" when publishing asp.net 5 from Visual Studio 2015
The question is, how do you easily remove these files when you need to clean up, restore, or archive a project?
Simple answer is file system basics. Create a directory in the same root as your project and give it a really short name (like "c:\t"). Then move all the files in node_modules there. then delete them.
I hear ms is working on a more workable gulp folder structure.
The reason you are hitting the NTFS file, path and name length limit of 255 characters is because of NPM nesting of package dependencies, which is a known Node issue on the Windows stack. You should try to update NPM to the latest version, 3.0 or greater, where they now use a flat approach to handle package dependencies. This will help you avoid the problem "unable to delete" because you will never have paths beyond 255 characters.
Perform the following:
1) Update NPM on your machine, by updating to the latest version of Node (download from https://nodejs.org/download).
2) Update Visual Studio 2015 External Web Tools to point to the folder with the new tools. (Tools-Options-Projects And Solutions-External Web Tools).
Usually:
C:\Program Files\nodejs"
or
C:\Program Files (x86)\nodejs"
Make sure this is the top option on the list of paths.
3) (On automated build) Make sure that Visual Studio does not use the packaged NodeJS version when building your project by passing in the following parameter to MSBuild.
/p:ExternalToolsPath="C:\Program Files\nodejs"
or (x86) if applies:
/p:ExternalToolsPath="C:\Program Files (x86)\nodejs"
After doing a lot of head hunting, I found about robocopy and this command has been my friend since then. I use the following steps to remove a file or folder when the windows path is too long
Create a folder anywhere in your system to use as a source (leave it empty).
Take back up from the folder you want to delete (if there is something important)
Open Command prompt
Type the following command. Modify the placeholders to suit your needs.
robocopy C:\path-to-source-empty-folder E:\path-to-folder-you-cant-delete /purge.
Note: If there are spaces in source or destination path in Step 4, the path must be enclosed by quotation marks.
After successful execution of the command, you will get execution report like the following
Everything inside the destination folder will be deleted forever.
You can also type robocopy in command prompt to see other options.
I hope this helps.

Using SSIS package to zip all the txt files and move to related folder [duplicate]

I am trying to zip the contents of a Folder in SSIS, there are files and folders in the source folder and I need to zip them all individually. I can get the files to zip fine my problem is the folders.
I have to use 7.zip to create the zipped packages.
Can anyone point me to a good tutorial. I haven't been able to implement any of the samples that I have found.
Thanks
This is how I have configured it.
Its easy to configure but the trick is in constructing the Arguments. Though you see the Arguments as static in the screenshot, its actually coming from a variable and that variable is set in the Arguments expression of Execute Process Task.
I presume you will have this Execute Process task in a For Each File Ennumerator with Traverse SubFolders checked.
Once you have this basic setup in place, all you need to do is work on building the arguments to do the zipping, how you want them. A good place to find all the command line arguments is here.
Finally, the only issue I ran into was not providing a working directory in the command line arguments for 7zip. The package used to run fine on my dev environment but used to fail when running on the server via a SQL job. This was because 7zip didn't have access to the 'Temp' folder on the SQL Server, which it uses by default as the 'working directory'. I got round this problem by specifying the 'working directory as follows at the end of the command line arguments, using the -ws switch:
For e.g:
a -t7z DestinationFile.7z SourceFile -wS:YourTempDirectoryToWhichTheSQLAgentHasRights

Changing target directory for a pre-build command in VS 2005

I'm programming in VB using Visual Studio 2005 Professional.
I have a code munger perl script that generates some of the *.vb files that I want to compile. The script and the associated files are in my project directory, and when I run the script from the OS command prompt, it writes the files in the same directory, which is what I want.
Rather than do this, I want to invoke the perl script as a pre-build event. I've gotten it to work ... almost. The only issue now is that the files are now deposited in TargetDir (/bin/Release e.g.) instead of ProjectDir. I could just change TargetDir to be ProjectDir, but that seems like I'm asking for trouble.
Is there a way to separately specify the target directory for pre-build commands? Or change it to ProjectDir, then change it back after I'm done with the pre-build? Or maybe I just need to write a command that moves the files back where I want?
Thanks in advance!
You can simply prepend a cd command to your command:
cd ProjectDir
do_my_stuff
Your custom build step will be written out as a batch file by Visual Studio and run with cmd.exe, so cd commands will work just fine.