Hello Guest, Welcome to Apnea Board !
As a guest, you are limited to certain areas of the board and there are some features you can't use.
To post a message, you must create a free account using a valid email address.

or Create an Account


New Posts   Today's Posts

what's wrong with this fragment of windows batch code?
#11
(05-07-2015, 11:23 PM)surferdude2 Wrote: That doesn't make any difference, either - or / should work. You just can't use the /t switch with the /l. I've never had any program squawk when using shutdown /l and letting the system handle the rest.

That I didn't know. I am syncing several machines by doing a backup of data files to my NAS using ROBOCOPY. Then using that backup and ROBOCOPY to update a machine. When the last ROBOCOPY finishes I am using TIMEOUT in the script to give it 30 seconds to make sure writes have finished. Then I need it to logout for security. So, it's working.


Admin Note:
JustMongo passed away in August 2017
Click HERE to read his Memorial Thread

~ Rest in Peace ~
Post Reply Post Reply
#12
(05-08-2015, 10:31 AM)justMongo Wrote:
(05-07-2015, 11:23 PM)surferdude2 Wrote: That doesn't make any difference, either - or / should work. You just can't use the /t switch with the /l. I've never had any program squawk when using shutdown /l and letting the system handle the rest.

That I didn't know. I am syncing several machines by doing a backup of data files to my NAS using ROBOCOPY. Then using that backup and ROBOCOPY to update a machine. When the last ROBOCOPY finishes I am using TIMEOUT in the script to give it 30 seconds to make sure writes have finished. Then I need it to logout for security. So, it's working.

In the past when I used ROBOCOPY under the task scheduler, I didn't need to be logged in for it to execute its code.
______________________
Useful Links -or- When All Else Fails:
Posting SleepyHead Charts in 5 Easy Steps
Robysue's Beginner's Guide to Sleepyhead
Apnea Helpful Tips
Post Reply Post Reply
#13
(05-08-2015, 12:16 PM)sgearhart Wrote:
(05-08-2015, 10:31 AM)justMongo Wrote:
(05-07-2015, 11:23 PM)surferdude2 Wrote: That doesn't make any difference, either - or / should work. You just can't use the /t switch with the /l. I've never had any program squawk when using shutdown /l and letting the system handle the rest.

That I didn't know. I am syncing several machines by doing a backup of data files to my NAS using ROBOCOPY. Then using that backup and ROBOCOPY to update a machine. When the last ROBOCOPY finishes I am using TIMEOUT in the script to give it 30 seconds to make sure writes have finished. Then I need it to logout for security. So, it's working.

In the past when I used ROBOCOPY under the task scheduler, I didn't need to be logged in for it to execute its code.

I'm not running on a schedule. If I were not logged in, and I had multiple users, how would ROBOCOPY know what user files I wish to move?

One line in my code is:
ROBOCOPY "\\192.168.2.103\%MNAME%\%FN%\My Documents\%XFOLD%" "%HOMEDRIVE%%HOMEPATH%\Documents\%XFOLD%" /S /E /R:0 /DCOPY:T /NP /LOG+:%ELOG%

%HOMEPATH% is a global variable that contains the username.
I also have to pass %FN% to the batch file as it is the name of the backup folder on the NAS in format DDMMMYYYY_HHMMSS

BTW -- a friend of mine showed me how to use powershell to initiate a backup to external drive:
wbAdmin start backup -backupTarget:X: -include:C: -allCritical -quiet

He then showed my how to drill down into a backup and mount the folder as a drive; then one can pluck out a file that was accidentally deleted or buggered up.

Admin Note:
JustMongo passed away in August 2017
Click HERE to read his Memorial Thread

~ Rest in Peace ~
Post Reply Post Reply


#14
(05-08-2015, 12:52 PM)justMongo Wrote: I'm not running on a schedule. If I were not logged in, and I had multiple users, how would ROBOCOPY know what user files I wish to move?

OK, I have it setup to look at several directories and update or delete the data on the NAS that was modified or deleted in the original directories since that last backup. I have it set in task scheduler to run at 3AM so it won't interfere with anything I'm doing.
______________________
Useful Links -or- When All Else Fails:
Posting SleepyHead Charts in 5 Easy Steps
Robysue's Beginner's Guide to Sleepyhead
Apnea Helpful Tips
Post Reply Post Reply
#15
I realize that this thread has matured but I wanted to post an aid to ROBOCOPY.

Microsoft has a program named, Robocopy GUI 3.1.2. This program wraps all the command line functionality of Robocopy into a graphical program that allows you to save the script that you create with it. The documentation is in a ".doc" format that made reading it better than trying to read the command line version.
______________________
Useful Links -or- When All Else Fails:
Posting SleepyHead Charts in 5 Easy Steps
Robysue's Beginner's Guide to Sleepyhead
Apnea Helpful Tips
Post Reply Post Reply
#16
Does this logout based on inactivity?
Never had to deal with batch files in windows so not familiar with TIMEOUT and other things you used in there. Only used them for batch file movement.
Post Reply Post Reply


#17
(05-01-2015, 03:40 PM)sgearhart Wrote: Now I'm just a half an idiot.

ID5T?
Post Reply Post Reply
#18
(09-16-2015, 03:25 AM)YTN3rd Wrote: Does this logout based on inactivity?
Never had to deal with batch files in windows so not familiar with TIMEOUT and other things you used in there. Only used them for batch file movement.

I use SHUTDOWN -L at the end of the batch script to logout since I walk away from the machine when the batch script is running.

SHUTDOWN -S will do an orderly shutdown.

Admin Note:
JustMongo passed away in August 2017
Click HERE to read his Memorial Thread

~ Rest in Peace ~
Post Reply Post Reply
#19
(09-16-2015, 10:00 AM)SaldusMiegas Wrote:
(05-01-2015, 03:40 PM)sgearhart Wrote: Now I'm just a half an idiot.

ID5T?

Dielaughing Took me 9,192,631,770 vibrations of a Cesium-133 atom in a vacuum to get that.


Using FlashAir W-03 SD card in machine. Access through wifi with FlashPAP or Sleep Master utilities.

I wanted to learn Binary so I enrolled in Binary 101. I seemed to have missed the first four courses. Big Grinnie

Post Reply Post Reply




Possibly Related Threads...
Thread Author Replies Views Last Post
  Windows 10 Update 10/2017 SarcasticDave94 17 550 11-08-2017, 01:53 PM
Last Post: AlanE
Question Was I wrong for this? deathscreton 6 309 09-21-2017, 06:02 PM
Last Post: Sleeprider
  December 2016 security monthly quality rollup for Windows 7 justMongo 8 1,072 12-31-2016, 07:51 AM
Last Post: JonC
  Still want Windows 10 for free? AlanE 1 520 09-23-2016, 07:23 PM
Last Post: AlanE
  a little help with PHP code for logins justMongo 12 865 09-19-2016, 06:08 PM
Last Post: eseedhouse
  Windows 7 and 8.1 Users Crimson Nape 20 1,340 08-25-2016, 08:10 PM
Last Post: FrankNichols
  Windows 10 - Install Heads-Up and a Vent Crimson Nape 11 755 07-24-2016, 02:51 PM
Last Post: justMongo

Forum Jump:

New Posts   Today's Posts




About Apnea Board

Apnea Board is an educational web site designed to empower Sleep Apnea patients.

For any more information, please use our contact form.