- Start regedit.exe.
- Go to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders.
- Double-click Personal (for My Documents) and change the value.
- Close regedit.
- Log off and restart the machine for the change to take effect.
Articoli con tag windows
How to change “My Documents” folder path
Copy files and folders with Robocopy mantaining dates
robocopy <source_path> <destination_path> /E /dcopy:DAT
/E : copy subdirectories, also empty ones
/dcopy:DAT : maintain edit/creation dates
Manual Account Setup on Outlook
C:\Program Files (x86)\Microsoft Office\root\Office16>OUTLOOK.EXE /manageprofiles
From cmd
How To Repair Broken EFI Partition
Steps:
- Enter Windows Setup or Windows Recovery to get cmd (Command Prompt)
- Make sure that both your Windows Partition and EFI Partition are assigned a drive letter
- Use diskpart utility to assign a letter to the EFI Partition (i.e.: T:)
- Make sure you know which drive letter each partition is assigned
- When you’ve got both partitions ready with a drive letter use this command:
- C:\Windows\System32\bcdboot C:\Windows /s T:
- That will cause the EFI bootloader files to be copied from you Windows Partition onto your EFI partition which should get it working.
Printer Spool Temp Files Path
C:\Windows\System32\Spool\Printers
Stop spool service
delete all files
start spool service
Create Desktop Shortcuts via GPO
- User Conguration
- Preferences
- Windows Settings
- Shortcuts
- New -> Shortcut
- update
- name of the link ( myfolder\mylink )
- file system object
- Desktop
- \\mypath\mylink
Symbolic Link on Windows
c:> mklink /d c:\some\directory \\some_server\some_share
This will create a folder named c:\some\directory which will show the content of the share \\some_server\some_share.
This will work also with a remote disk with i.e. \\some_server\C$.
Auto execution of an Excel file
MyFile.bat:
runas /user:mydomain\myuser “C:\Program Files\Microsoft Office\Office14\excel.exe \\myserver\path\to\file\myfile.xlsx”
If the excel fila has an auto_load macro it’s possibile to execute an update and close the file saving changes automatically.
HwGroup SMS-GW3
Links:
https://www.hw-group.com/support/how-to-send-sms-via-hwg-sms-gw3
https://www.hw-group.com/accessory/sms-gw3
Methods of sending text messages:
Using netGSM (SOAP – HTTP POST)
Uploading a XML file using cURL
Uploading a XML file using PHP
Sending a SMS from Nagios
Using HTTP GET
Sending a SMS from Nagios
Sending a SMS using Wget
Sending a SMS using cURL
Sending a SMS from PRTG
Using the SNMP Write function
Sending text messages using the netGSM protocol
The netGSM protocol is based on SOAP; that is, sending a XML file using HTTP POST. For a description of the netGSM protocol, see: http://hw-group.us/product-version/netgsm
In a nutshell, HTTP POST is used to send a XML file (service.xml) with the following structure:
GsmOut
SMS
123456789
Hello World!
For a description of individual parameters, see the above-mentioned protocol description.
Uploading a XML file using cURL
cURL is a command-line tool to transfer data using protocols such as HTTP, FTP and more. cURL consists of two parts – the curl.exe console application, and the libcurl.dll library that implements all the curl functions.
The library can be used for writing your own scripts (bindings are available for many languages).
cURL is available free of charge at https://curl.haxx.se/ (https://curl.haxx.se/download.html) however, attention must be paid to choose the correct version to download.
The 32-bit version will not work in a 64-bit Windows environment, even though it starts OK!
cURL is started from the command line with the following command:
curl -X POST -T service.xml 192.168.100.169
where
-X defines the transfer method, in this case POST
-T specifies that a file is uploaded and what is its name (the file must be in the same folder as the curl.exe utility; otherwise, the path must be given)
IP address is the address of HWg-SMS-GW3
If the HWg-SMS-GW3 is secured with a username and a password, the credentials must be specified with the -u parameter:
curl -X POST -T service.xml -u user:pass 192.168.100.169
The response is:
C:\Users\volmr\Desktop\curl>curl -X POST -T service.xml -u user:pass 192.168.100.169
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 375 0 0 0 0 0 0 –:–:– 0:00:01 –:–:– 0
1
169
100 667 100 292 100 375 292 375 0:00:01 0:00:01 –:–:– 657
C:\Users\volmr\Desktop\curl>
Uploading a XML file using PHP
PHP is one of the most popular open source web scripting language. Sending a SMS from your own website is very simple; an example script follows:
GsmOut
“.$type.”
“.$nmr.”
“.$text.”
“;
$fp = @fsockopen($host, $port, $errno, $errstr, 30);
if (!$fp) {
echo “$host:$port: $errstr ($errno)\r\n”;
}
else {
fwrite($fp, “POST /service.xml HTTP/1.0\r\n”);
fwrite($fp, “User-Agent: MyPHPTest\r\n”);
fwrite($fp, sprintf(“Host: %s\r\n”, $host));
fwrite($fp, sprintf(“Authorization: Basic %s\r\n”, base64_encode($user . “:” . $pass)));
fwrite($fp, sprintf(“Content-Length: %d\r\n\r\n”, strlen($xml)));
fwrite($fp, $xml);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>
Simply fill out the address, username and password for your HWg-SMS-GW3 and everything works right away. The $type, $nmr and $text variables can be of course passed from other scripts.
Sending a SMS from Nagios
Nagios uses scripts written in Perl. The Netways company from Germany has provided the notify-poseidon-sms.pl script that can send up to 160 characters with this command:
./notify-poseidon-sms.pl -H 192.0.2.10 -M “Test message” -D 123456789
where:
-H – (Host) IP address of HWg-SMS-GW3
-M – (Message) message text
-D – (Destination) recipient’s telephone number
A limitation is that the script can only send SMS and cannot ring the recipient’s phone number; however, this can be easily changed, see e.g. notify-poseidon-call.pl (see the attachments). Also, it does not support http authentication.
Example of use in Windows:
C:\Users\volmr\Desktop\curl>perl notify-poseidon-sms.pl -H 192.168.100.169 -M “Hello World!” -D 777232759
OK, message sent with ID 1 to ‘777232759’
C:\Users\volmr\Desktop\curl>
Sending text messages using HTTP GET
HTTP GET is a method where all parameters are passed directly in the URL. This method is often used for simple applications because it allows for simple debugging and is easy to code. One simply invokes the address with the necessary parameters:
values.xml?Cmd=SMS&Nmr=00420123456789&Text=Hello World!
where:
Values.xml – file in the GW that the command should process. It is either values.xml or service.xml
Cmd – command that instructs what the GW should do: SMS – send a text message, CALL – ring the number
Nmr – phone number in national or international format. It is recommended to use 00 instead of the “+” sign so that there is no need to replace the “+” with an entity
Text – message text encoded in UTF-8
A disadvantage is that the HTTP GET method, natively used to display WWW pages, is difficult to secure against misuse (one would need to set WWW Security, which then prevents unrestricted browsing of the HWg-SMS-GW3 web interface).
And even then, the login credentials are sent in the URL in the open:
http://user:pass@192.168.1.1/values.xml?Cmd=SMS&Nmr=777232759&Text=Hello 20World!
For these reasons, the sending of messages via HTTP GET is disabled by default, and must be manually enabled at the GSM Modem tab if it is needed:
Sending a SMS from a web browser
Enter the URL of HWg-SMS-GW3 including the requested commands into the address field of the web browser:
http://192.168.100.169/values.xml?Cmd=SMS&Nmr=777232759&Text=Hello World!
After sending, a XML confirmation appears:
1
2
Sending SMS using Wget
GNU Wget is a command-line utility that serves as a simple but powerful http client. It implements file transfer over HTTP, HTTPS and FTP protocols. It is available at https://www.gnu.org/software/wget/ and Windows versions are available at http://gnuwin32.sourceforge.net/packages/wget.htm
Wget is very simple to use – simply enter the same command that would be entered in the browser address field. However, the entire URL must be enclosed in double quotes:
wget “http://192.168.100.169/values.xml?Cmd=SMS&Nmr=777232759&Text=Hello World!”
The result looks like this:
C:\Users\volmr\Desktop\wget>wget “http://192.168.100.169/values.xml?Cmd=SMS&Nmr=777232759&Text=Hello World!”
–2017-12-28 15:56:35– http://192.168.100.169/values.xml?Cmd=SMS&Nmr=777232759&Text=Hello%20World!
Connecting to 192.168.100.169:80… connected.
HTTP request sent, awaiting response… 200 Ok
Length: unspecified [text/xml]
Saving to: ‘values.xml@Cmd=SMS&Nmr=777232759&Text=Hello%20World!.1’
values.xml@Cmd=SMS&Nmr=777232 [ <=> ] 118 –.-KB/s in 0s
2017-12-28 15:56:35 (5.48 MB/s) – ‘values.xml@Cmd=SMS&Nmr=777232759&Text=Hello%20World!.1’ saved [118]
C:\Users\volmr\Desktop\wget>
Sending SMS using cURL
The cURL utility is used in the same way as the wget utility. This is the command:
curl “http://192.168.100.169/values.xml?Cmd=SMS&Nmr=777232759&Text=Hello World!”
And this is the application’s response:
C:\Users\volmr\Desktop\curl>curl “http://192.168.100.169/values.xml?Cmd=SMS&Nmr=777232759&Text=Hello World!”
1
4
C:\Users\volmr\Desktop\curl>
Of course, the main result is that the message is sent.
Sending a SMS from PRTG
PRTG Network Monitor is a complex network monitoring solution that combines Paessler’s expertise with a complete set of monitoring functions, intuitive and easy-to-use UI and the most advanced monitoring tool suitable for all types of networks.
PRTG Network Monitor can send text messages using the HTTP GET method. The setting up only involves specifying a URL for sending the messages.
This is done with the Enterprise Console (application or WWW interface) in Setup > System Administration > Notification Delivery. The Custom URL field should contain:
http://IP_adresa/values.xml?Cmd=SMS&Nmr=%SMSNUMBER&Text=%SMSTEXT
This ensures that the SMSNUMBER and SMSTEXT system variables are inserted at the correct places in the URL.
PRTG currently does not support security using username and password!
Sending a SMS using the SNMP Write function (snmpset)
Starting from firmware version 1.1.3, HWg-SMS-GW3 supports the sending of SMS and dialing of numbers using SNMP. SNMP write, or more exactly SNMP SET function, is used for that purpose.
However, it is necessary to write all the 3 required OIDs for the recipient’s number, message text and function (SMS/ring/SMS+ring). The OIDs are the following:
msgQueueNmr (OID .1.3.6.1.4.1.21796.4.10.2.2.0) – (mandatory) Recipient’s phone number in national or international format. The international format can use either “+” or “00”.
msgQueueCmd (OID .1.3.6.1.4.1.21796.4.10.2.3.0) – (mandatory) Action: 1=sms, 2=ring, 3=sms+ring
msgQueueText (OID .1.3.6.1.4.1.21796.4.10.2.1.0) – (mandatory) Message text. Can be omitted if the requested action is ring only.
In a concrete example, the individual commands could look like this:
snmpset -v 1 -c private 192.168.100.169 1.3.6.1.4.1.21796.4.10.2.2.0 i: 777232759
snmpset -v 1 -c private 192.168.100.169 1.3.6.1.4.1.21796.4.10.2.1.0 s “Hello World!”
snmpset -v 1 -c private 192.168.100.169 1.3.6.1.4.1.21796.4.10.2.3.0 i: 1
When the commands are entered in the command line, the following appears:
C:\usr\bin>snmpset -v 1 -c private 192.168.100.169 1.3.6.1.4.1.21796.4.10.2.2.0 i: 777232759
SNMPv2-SMI::enterprises.21796.4.10.2.2.0 = INTEGER: 777232759
C:\usr\bin>snmpset -v 1 -c private 192.168.100.169 1.3.6.1.4.1.21796.4.10.2.1.0 s “Hello World!”
SNMPv2-SMI::enterprises.21796.4.10.2.1.0 = STRING: “Hello World!”
C:\usr\bin>snmpset -v 1 -c private 192.168.100.169 1.3.6.1.4.1.21796.4.10.2.3.0 i: 1
SNMPv2-SMI::enterprises.21796.4.10.2.3.0 = INTEGER: 1
C:\usr\bin>
The command to ring the number then looks like this:
snmpset -v 1 -c private 192.168.100.169 1.3.6.1.4.1.21796.4.10.2.2.0 i: 777232759
snmpset -v 1 -c private 192.168.100.169 1.3.6.1.4.1.21796.4.10.2.3.0 i: 2
and the response:
C:\usr\bin>snmpset -v 1 -c private 192.168.100.169 1.3.6.1.4.1.21796.4.10.2.2.0 i: 777232759
SNMPv2-SMI::enterprises.21796.4.10.2.2.0 = INTEGER: 777232759
C:\usr\bin>snmpset -v 1 -c private 192.168.100.169 1.3.6.1.4.1.21796.4.10.2.3.0 i: 2
SNMPv2-SMI::enterprises.21796.4.10.2.3.0 = INTEGER: 2
C:\usr\bin>
Recent Comments