Tag Info

New answers tagged

1

I found that I needed to add cmd /c to the beginning of the icacls command. My batch file looks like this: for /f "tokens=*" %%i in (%1) do ( cmd /c "icacls.exe F:\home\%%i /grant %%i:(oi)(ci)(m)" ) ) This works fine for me.


0

The second example you posted (explicitly casting the parameter variable) is the correct way to go: Function Test-Me { Param( [System.Collections.ArrayList] $Properties = @("red","blue","green") ) Write-Host $Properties.GetType().FullName if("Orange" -notin $Properties){ [void]$Properties.Add("orange") } ...


0

For ranges of this magnitude, I would advise to refrain from creating ranges (i.e., arrays full of integer values for scanning). Your approach is solid. If you really want a case statement, you could go for a piece of Ruby code and the inline_template function, but that has a performance penalty and does not add much in terms of maintainability.


0

I feel that the easiest way to do this is by opening up Script Editor... pasting the following in it. Which is a script that will restart the computer into windows. Make sure you change the password to yours though. all you have to do is double click it and it will automatically do everything for you. Leave everything like it is except for the line that says ...


1

Yes, it's about permission. But not related to Upstart. This is because in 'catalina.sh start', i.e. in the 'start' part, the real command is: ... -Djava.io.tmpdir="\"$CATALINA_TMPDIR\"" \ org.apache.catalina.startup.Bootstrap "$@" start \ >> "$CATALINA_OUT" 2>&1 "&" Here the output log is fully assigned. While there is no ...


0

cron does not run with the same environnent as an interactive shell. Your $HOSTNAME variable is not set. You can set it at the start of your script like so: HOSTNAME="`/usr/bin/hostname`"


3

If you want all the jpg and xml files into one folder, you could use Get-ChildItem -Include: Get-ChildItem -Include *.jpg,*.xml -Recurse | ForEach-Object { Copy-Item -Path $_.FullName -Destination D:\Users\MS5253\Desktop\Lots }


-1

This is the answer as it swap to left handed then click again and it swaps back. The SwapMouseButtons only goes to left handed but not back Change between left and right handed and back with one script - click once it changes then click again and it changes it back vs. the RUNDLL32.EXE USER32.DLL,SwapMouseButton which only swaps to left hand but not back ...


0

Servers should use UTC in order to simplify server management; especially when you are managing resources across multiple time zones. Furthermore ntp knows nothing about time zones, ntp strictly deals in UTC.


0

Using %%d allows md to make directories with spaces. for /F "tokens=1 delims=," %%d IN (folderlist.txt) DO md "%%d"


0

Based on the functions it seems like the --no-chroot option may be causing the issue in this case. Alternately the path where the root image is located may need to be appended to some of the paths where data is redirected typically something like /mnt/sysimage/root with CentOS. So it would be possible to set a variable like this and append it where ...


1

Some differences on Bash 4.3.11: < [[ a < b ]]: lexicographical comparison [ a \< b ]: Same as above. \ required or else does redirection. Bash extension. = [[ ab = a? ]]: true, because it does pattern matching (* ? [ are magic). Does not glob expand to files in current directory. [ ab = a? ]: a? glob expands. So may be true or false ...


0

Due to this site I tried to add -Identity at the end of the line, as in the line on the top. This worked for me. Thanks! BTW:I excluded also some other users, because I don't know exactly what they do, am afraid to delete too much. I also added -confirm:$false. Get-MailboxPermission -Identity $TheUser | where {($_.User -notlike "NT AUTHORITY\SELF") -and ...


1

The IIS 6 SMTP server? The config for this is in the IIS metabase XML file at systemroot\system32\inetserv\metabase.xml Line: RelayIpList VBS to set relay IPs: Option Explicit Dim objSMTP,objRelayIpList,objCurrentList,objIP,objFSO,objTextFile,count,newIpList(),inputOption Set objSMTP = GetObject("IIS://localhost/smtpsvc/1") Set objRelayIpList = ...


0

I tend to use it like this: psexec.exe \\LAB-PC1 -u LAB-Pc01\admin -p S3cret! -i -d cmd /c shutdown /r /f /t 1 Command line break down: (psexec part) -i Interactive session -d don't wait for process to terminate (cmd part) cmd windows shell on remote host /c Run command and then terminate from here shutdown windows shutdown command /r restart ...


0

Might I recommend PsShutdown? You seem more inclined for PsTools but I don't think PsExec is the proper tool. For shutdown -m, you could iterate over it with a for loop I suppose?


3

Instead of fiddling around with psexec for this, why not just call shutdown.exe directly with the /m switch? shutdown.exe -m \\server.domain.local -s -f -t 0 You can even keep your list of servers in the same file by using a for command. See the for documentation if you want to use a non-default (space and tab) delimiter: for /f %%SERVER in ...



Top 50 recent answers are included