scripting

How mark Scripting.FileSystemObject as safe for scripting?

故事扮演 提交于 2021-01-27 20:32:16
问题 Introduction: I'm programing a CNC machine. To be exact a Rover from Biesse. The editor from the software that is used to programing support VBScript. VBScript is used for implementing conditional statments and loops etc. In instruction to the software i have listed all syntax from VBScript marked as not to be used to avoid complication :) Of course I would like to use VBScript :) To be exact - to open txt file and set up program base on the content. The main problem: All the syntax of the

Encapsulate the output of invoke command in a variable - PowerShell

社会主义新天地 提交于 2021-01-27 19:23:43
问题 I have a script that installs Remote Desktop Services on remote machines (from the DC). I'm now at the phase where I check if RDS installed on the connection broker (server) and connection host (server). I want to use invoke-command since a remote powershell session seemed too complicated. This is the code I have: $res = Invoke-Command -ComputerName "testpc.eil.local" -ScriptBlock { if((Get-WindowsFeature -Name "Remote-Desktop-Services").Installed -eq 1) { #i need this output (true or false

Batch Script not raising ERRORLEVEL on failure

两盒软妹~` 提交于 2021-01-27 16:00:27
问题 I am learning Windows batch scripting. I need to raise errors when copy, move or delete operations fail. I have made a sample script and for some reason, when the operation fails I cannot get the ERRORLEVEL to rise. I run the script and the files either do not exist or are opened in another program and stderr messages are output to console, but ERRORLEVEL never rises, why is this? Also, is there any way to pipe stderr into a variable I could check, if I cannot get ERRORLEVEL to rise? My code

Leaving sourced shell script without exiting terminal

江枫思渺然 提交于 2021-01-27 14:30:39
问题 I'm writing a shell script to save some key strokes and avoid typos. I would like to keep the script as a single file that calls internal methods/functions and terminates the functions if problems arise without leaving the terminal. my_script.sh #!/bin/bash exit_if_no_git() { # if no git directory found, exit # ... exit 1 } branch() { exit_if_no_git # some code... } push() { exit_if_no_git # some code... } feature() { exit_if_no_git # some code... } bug() { exit_if_no_git # some code... } I

How to use multiple classes in multiple files in scripts?

a 夏天 提交于 2021-01-27 11:45:26
问题 I need to make a standalone Groovy script that does not require compilation and runs without Groovy installed. It works well, but it fails to recognize any other script than the main script. My folder structure is the following: libs\ groovy-all-2.4.3.jar ivy-2.4.0.jar src\ makeRelease.groovy ReleaseHelper.groovy I am launching the script this way from the src folder: java -cp "../libs/*" makeRelease.groovy makeRelease looks like this: public class makeRelease { public static void main(String

After table.getn got deprected in Logitech 5.4 LUA this code doesn't seems to work anymore

自闭症网瘾萝莉.ら 提交于 2021-01-27 07:08:38
问题 After Logitech API got updated for the 5.4 Lua version, table.getn got deprected and some guys that helped me said I could update the code with # but the logic of the code doesn't seems to work anymore with this replacement, I have tried making some workaround the code but I'm not very familiar with programming, how could I fix this code for Logitech API? Could someone guide me? Sense = 1.4; --Rate of FIRE (in seconds) G36ROF = 10 --600RPM. HKROF = 11.1 --666RPM. ROF = {G36ROF, HK417ROF} -

Start debugging specific project programmatically using EnvDTE.ExecuteCommand

梦想与她 提交于 2021-01-27 03:49:51
问题 I have a solution with multiple start-up projects, and I am trying to relaunch one of them automatically on a nightly basis, while keeping the new process attached to the same debugger. I was able to restart the process (using Process.Start ) and attach the current debugger to it, but it has not been highly reliable so far, and by design, clicking on the Stop button only detaches from the process rather than terminating it. I am aware the Visual Studio team has released a Visual Studio

find command in bash script resulting in “No such file or directory” error only for directories?

不问归期 提交于 2021-01-17 07:49:44
问题 UPDATE 2014-03-21 So I realized I wasn't as efficient as I could be, as all the disks that I needed to "scrub" were under /media and named " disk1 , disk2 , disk3 , etc." Here's the final script: DIRTY_DIR="/media/disk*" find $DIRTY_DIR -depth -type d -name .AppleDouble -exec rm -rf {} \; find $DIRTY_DIR -depth -type d -name .AppleDB -exec rm -rf {} \; find $DIRTY_DIR -depth -type d -name .AppleDesktop -exec rm -rf {} \; find $DIRTY_DIR -type f -name ".*DS_Store" -exec rm -f {} \; find $DIRTY

find command in bash script resulting in “No such file or directory” error only for directories?

橙三吉。 提交于 2021-01-17 07:47:25
问题 UPDATE 2014-03-21 So I realized I wasn't as efficient as I could be, as all the disks that I needed to "scrub" were under /media and named " disk1 , disk2 , disk3 , etc." Here's the final script: DIRTY_DIR="/media/disk*" find $DIRTY_DIR -depth -type d -name .AppleDouble -exec rm -rf {} \; find $DIRTY_DIR -depth -type d -name .AppleDB -exec rm -rf {} \; find $DIRTY_DIR -depth -type d -name .AppleDesktop -exec rm -rf {} \; find $DIRTY_DIR -type f -name ".*DS_Store" -exec rm -f {} \; find $DIRTY

find command in bash script resulting in “No such file or directory” error only for directories?

只愿长相守 提交于 2021-01-17 07:46:32
问题 UPDATE 2014-03-21 So I realized I wasn't as efficient as I could be, as all the disks that I needed to "scrub" were under /media and named " disk1 , disk2 , disk3 , etc." Here's the final script: DIRTY_DIR="/media/disk*" find $DIRTY_DIR -depth -type d -name .AppleDouble -exec rm -rf {} \; find $DIRTY_DIR -depth -type d -name .AppleDB -exec rm -rf {} \; find $DIRTY_DIR -depth -type d -name .AppleDesktop -exec rm -rf {} \; find $DIRTY_DIR -type f -name ".*DS_Store" -exec rm -f {} \; find $DIRTY