Posts Categorized: Command Line

Copy exe as text via clipboard to a remote desktop

Posted by & filed under Command Line.

Sometimes you are not allowed to transfer files between machines but you can transfer text via clipboard. A little hack how to transfer a file using a standard Windows utility certutil.  Create a text file encoding the file certutil -encode file.exe file.txt Open and copy text Create a new file on the remote desktop and […]

Creating ODBC system DNS with command line

Posted by & filed under Command Line, SQL Server.

%WINDIR%\System32\odbcconf.exe CONFIGSYSDSN "SQL Server" "DSN=macoprod|Description=macoprod|SERVER=10.2.151.18|Trusted_Connection=No|Database=macoprod" %WINDIR%\SysWOW64\odbcconf.exe CONFIGSYSDSN "SQL Server" "DSN=macoprod|Description=macoprod|SERVER=10.2.151.18|Trusted_Connection=No|Database=macoprod"

Prevent Accidental Start of a Batch File

Posted by & filed under Command Line.

To prevent accidental start of a batch file (e.g. restarting services or a starting load), you can add the following lines in the beginning. Use Y as a first argument when scheduling the file You will be prompted to answer whether you want to continue, if you start the batch. @echo off if /I "%1"=="Y" […]